1.2.3. 使用 Git secret
在相关命名空间中创建 secret 后,您可以在 Build 自定义资源(CR)中引用它。您可以使用两种类型的身份验证配置 Git secret。
以下示例显示了使用带有 SSH 验证类型的 Git secret:
apiVersion: shipwright.io/v1beta1
kind: Build
metadata:
name: buildah-golang-build
spec:
source:
git:
url: git@gitlab.com:userjohn/newtaxi.git
cloneSecret: secret-git-ssh-auth
以下示例显示了使用带有基本身份验证类型的 Git secret:
apiVersion: shipwright.io/v1beta1
kind: Build
metadata:
name: buildah-golang-build
spec:
source:
git:
url: https://gitlab.com/userjohn/newtaxi.git
cloneSecret: secret-git-basic-auth