我试图通过Gradle任务将一个文件复制到多个目的地.我在其他网站上发现了以下内容,但在运行此任务时出现错误.
def filesToCopy = copySpec{
from 'somefile.jar'
rename {String fileName -> 'anotherfile.jar'}
}
task copyFile(type:Copy) {
with filesToCopy {
into 'dest1/'
}
with filesToCopy {
into 'dest2/'
}
}
Run Code Online (Sandbox Code Playgroud)
错误
没有方法签名:org.gradle.api.internal.file.copy.CopySpecImpl.call()适用于参数类型
有没有办法在一个Gradle任务中复制到多个目的地?
如果以下数据结构中的文档列表不为空,我们需要显示一些消息。
{
"id:" 1,
"documents": [
{
"name": "2353626.jpg",
"type": "image"
}
]
}
Run Code Online (Sandbox Code Playgroud)
最初我们考虑在 JSON 中添加一个标志并尝试渲染小胡子模板。但我们希望避免这种情况,因为我们认为我们正在污染 UI 的 API 响应。
"hasDocuments": true
Run Code Online (Sandbox Code Playgroud)
方法一:
我们试图根据第 0 个元素显示一条消息
{{#documents.0}}
Documents available
{{/documents.0}}
{{^documents}}
Documents missing
{{/documents}}
Run Code Online (Sandbox Code Playgroud)
这在Mustache.js中效果很好,但我们需要使用Mustache.java的扩展才能使其工作@ https://gist.github.com/spullara/5331831
方法二:
我们试图访问空方法
{{^documents.empty}}
Documents available
{{/documents.empty}}
Run Code Online (Sandbox Code Playgroud)
不幸的是, mustache.js不支持此功能,但在Mustache.java中效果很好
我们计划采用第 0 元素方法。有没有更好的方法来识别列表是否不为空?
我正在尝试代理使用自签名证书运行的旧服务器。
简单的 nginx 配置:
server {
listen 8009;
location / {
proxy_ssl_verify off;
proxy_ssl_session_reuse off;
proxy_pass https://192.168.10.20:8009/;
}
}
Run Code Online (Sandbox Code Playgroud)
我在 nginx 日志中收到 SSL 握手错误。
2018/05/02 11:31:39 [crit] 3500#2284: *1 SSL_do_handshake() failed (SSL: error:14082174:SSL routines:ssl3_check_cert_and_algorithm:dh key too small) while SSL handshaking to upstream, client: 127.0.0.1, server: , request: "GET /ping HTTP/1.1", upstream: "https://192.168.10.20:8009/ping", host: "localhost:8009"
Run Code Online (Sandbox Code Playgroud)
我希望添加“proxy_ssl_verify off;” 会忽略所有 SSL 错误,但似乎不会。
我们的 nginx-ingress 日志不断充满以下错误消息:
dns.lua:61: resolve(): server returned error code: 3: name error, context: ngx.timer
Run Code Online (Sandbox Code Playgroud)
我们使用 Kubeadm 创建了 Kubernetes 集群,默认情况下使用 CoreDNS。
/data # kubectl get pods -n kube-system
NAME READY STATUS RESTARTS AGE
calico-node-8jr7t 2/2 Running 2 4d22h
calico-node-cl5f6 2/2 Running 4 4d22h
calico-node-rzt28 2/2 Running 2 4d22h
coredns-fb8b8dccf-n68x9 1/1 Running 3 3d23h
coredns-fb8b8dccf-x9wr4 1/1 Running 1 3d23h
Run Code Online (Sandbox Code Playgroud)
它还具有指向 core-dns pod 的 kube-dns 服务。
kube-system kube-dns ClusterIP 10.96.0.10 <none> 53/UDP,53/TCP 7m29s
Run Code Online (Sandbox Code Playgroud)
我在日志中找不到任何其他内容可以帮助我解决此问题。
更新:
我们有一个带有 externalName 的服务,如此处建议的> https://github.com/coredns/coredns/issues/2324#issuecomment-484005202