未验证 提交 3b8dc4ba 编写于 作者: S shaowenchen

fix SecretRef nil

Signed-off-by: Nshaowenchen <mail@chenshaowen.com>
上级 bb94d6da
......@@ -274,8 +274,12 @@ func (r *resourceHandler) handleVerifyGitCredential(request *restful.Request, re
api.HandleBadRequest(response, nil, err)
return
}
err = r.gitVerifier.VerifyGitCredential(credential.RemoteUrl, credential.SecretRef.Namespace, credential.SecretRef.Name)
var namespace, secretName string
if credential.SecretRef != nil {
namespace = credential.SecretRef.Namespace
secretName = credential.SecretRef.Name
}
err = r.gitVerifier.VerifyGitCredential(credential.RemoteUrl, namespace, secretName)
if err != nil {
api.HandleBadRequest(response, nil, err)
return
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册