我在bitbucket上托管了私人git存储库。按照openshift博客上的说明here,我尝试在openshift上配置此存储库,但是在使用openshift命令行(oc)工具注释秘密的步骤中,它失败了。出现以下错误。
$ oc annotate secret/repo-at-bitbucket \'build.openshift.io/source-secret-match-uri-1=ssh://username@bitbucket.org/username/my-app.git'
The Secret "repo-at-bitbucket" is invalid: metadata.annotations: Invalid value: "\\'build.openshift.io/source-secret-match-uri-1": prefix part a DNS-1123 subdomain must consist of lower
case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9
]([-a-z0-9]*[a-z0-9])?)*')
努力解决此问题。感谢任何指针。提前致谢。
答案 0 :(得分:1)
感谢Graham-感谢您的快速响应。我是新来的。
实际上找到了解决我问题的方法。在没有任何单引号的情况下尝试了该命令,该命令可以正常工作,或者换句话说,在运行后没有任何错误
oc注释secret / repo-at-bitbucket build.openshift.io/source-secret-match-uri-1=ssh://username@bitbucket.org/username/my-app.git
带有注释的秘密“回购桶”
答案 1 :(得分:0)
在该引号之前,您不应使用反斜杠。博客中的反斜杠代表了shell行的延续,因为命令不能全部显示在一行上。如果复制/粘贴到一行上,则应删除反斜杠。
顺便说一句,您现在可以对--source-secret
或oc new-app
使用oc new-build
选项,而不必使用注释。只需使用它来引用秘密名称,就不必理会注释。