Source clone secrets can be added manually to a build configuration by adding a
sourceSecret
field to the source
section inside the BuildConfig
and
setting it to the name of the secret
that you created (basicsecret
, in this
example).
apiVersion: "v1"
kind: "BuildConfig"
metadata:
name: "sample-build"
spec:
output:
to:
kind: "ImageStreamTag"
name: "sample-image:latest"
source:
git:
uri: "https://github.com/user/app.git"
sourceSecret:
name: "basicsecret"
strategy:
sourceStrategy:
from:
kind: "ImageStreamTag"
name: "python-33-centos7:latest"
Procedure
You can also use the oc set build-secret
command to set the source clone
secret on an existing build configuration.
-
To set the source clone secret on an existing build configuration, run:
$ oc set build-secret --source bc/sample-build basicsecret
Additional resources
-
Defining Secrets in the
BuildConfig
provides more information on this topic.