1

在我们公司,我们使用自己的带有自签名证书的 Git 存储库。

如果我尝试从外部 git 存储库在 OpenShift 中构建一个新应用程序,它不接受我们的证书(查看下面的日志)。只是使用git clone不会出错,所以原因很可能在 OpenShift 自己的 git 客户端。

以下是oc build-logs的详细信息:

如果它试图通过 ssh 克隆 repo:

I1005 09:26:33.661857       1 docker.go:203] Cloning source from ssh://username@git-repo-url:port/blablabla/xyz.git
E1005 09:26:33.718445       1 git.go:102] Clone failed: Host key verification failed.
fatal: Could not read from remote repository.

通过 https:

I1005 11:49:52.134760       1 docker.go:203] Cloning source from https://username@git-repo-url:port/blablabla/xyz.git
E1005 11:49:52.392426       1 git.go:102] Clone failed: fatal: unable to access 'https://username@git-repo-url:port/blablabla/xyz.git': Peer's certificate issuer has been marked as not trusted by the user.
F1005 11:49:52.392460       1 builder.go:54] Build error: exit status 128

.gitconfig中的 sslVerify 设置为 false。

任何想法如何让 OpenShift 接受证书或忽略它?非常感谢!

PS OpenShift Origin 是这样安装的: https ://github.com/openshift/openshift-ansible/blob/master/README_origin.md

更新:尝试了以下解决方案但没有效果: https ://docs.openshift.org/latest/dev_guide/builds.html#using-private-repositories-for-builds

版本:

oc v1.0.6-2-ge2a02a8 
kubernetes v1.1.0-alpha.0-1605-g44c91b1
4

1 回答 1

0

通过 Secret 提供 .gitconfig 的功能最近才添加到 OpenShift 中,您的部署有多最新?

如何提供 .gitconfig(包括设置 sslVerify)的说明在这里:https ://docs.openshift.org/latest/dev_guide/builds.html#other-authentication

于 2015-10-07T07:07:30.610 回答