How can a private Git repository be accessed by a BuildConfig during a build?

Prepare for the Red Hat OpenShift Developer II DO288 Exam with our quizzes. Study with flashcards and multiple choice questions, each with hints and explanations. Get ready for your certification!

Multiple Choice

How can a private Git repository be accessed by a BuildConfig during a build?

Explanation:
To access a private Git repository during a build, you provide credentials via a Secret and attach it to the BuildConfig as a source secret. Create a Secret that holds either an SSH private key (for SSH URLs) or basic authentication credentials (username/password or a token for HTTPS), and then reference that Secret in the BuildConfig’s source section as the sourceSecret. The build process will use those credentials to authenticate when cloning the private repository. This approach keeps credentials secure and is the supported method. Using a public URL with no credentials won’t work for private repos, and embedding credentials directly in the BuildConfig YAML is insecure and not recommended.

To access a private Git repository during a build, you provide credentials via a Secret and attach it to the BuildConfig as a source secret. Create a Secret that holds either an SSH private key (for SSH URLs) or basic authentication credentials (username/password or a token for HTTPS), and then reference that Secret in the BuildConfig’s source section as the sourceSecret. The build process will use those credentials to authenticate when cloning the private repository. This approach keeps credentials secure and is the supported method. Using a public URL with no credentials won’t work for private repos, and embedding credentials directly in the BuildConfig YAML is insecure and not recommended.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy