无法在 Powershell 中运行以下 Bash/Zsh 命令:
$KeyPath = Join-Path -Path $this.Plate -ChildPath "install/tekton.key"
kubectl create secret docker-registry regcred `
--docker-server="https://gcr.io" `
--docker-username=_json_key `
--docker-email="[email protected] /cdn-cgi/l/email-protection" `
--docker-password="$(cat $KeyPath)"
我收到错误:
error: exactly one NAME is required, got 5
See 'kubectl create secret docker-registry -h' for help and examples
如果我直接在 bash 中运行此命令,它会起作用:
kubectl create secret docker-registry regcred --docker-server="https://gcr.io" --docker-username=_json_key --docker-email="[email protected] /cdn-cgi/l/email-protection" --docker-password="$(cat ./tekton.key)"
我不知道这是否是您问题的原因,但是那里有两个潜在的问题:
旁注:PowerShell 的处理嵌入双引号传递给外部程序的参数被破坏 - 请参阅这个答案 https://stackoverflow.com/a/59036879/45375.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)