CNX-001 · Question #79
A cloud architect needs to change the network configuration at a company that uses GitOps to document and implement network changes. The Git repository uses main as the default branch, and the main br
The correct answer is B. Create a new branch for the change, then create a pull request including the changes.. In a GitOps workflow, the main branch represents the source of truth for the current desired state of the environment, and branch protection rules prevent direct commits to it. The standard GitOps process is to create a feature or change branch from main, make and commit changes
Question
A cloud architect needs to change the network configuration at a company that uses GitOps to document and implement network changes. The Git repository uses main as the default branch, and the main branch is protected. Which of the following should the architect do after cloning the repository?
Options
- AUse the main branch to make and commit the changes back to the remote repository.
- BCreate a new branch for the change, then create a pull request including the changes.
- CCheck out the development branch, then perform and commit the changes back to the remote
- DRebase the remote main branch after making the changes to implement.
How the community answered
(21 responses)- A5% (1)
- B86% (18)
- C5% (1)
- D5% (1)
Explanation
In a GitOps workflow, the main branch represents the source of truth for the current desired state of the environment, and branch protection rules prevent direct commits to it. The standard GitOps process is to create a feature or change branch from main, make and commit changes to that branch, then open a pull request (PR) for peer review and automated validation before merging into main. This ensures changes are reviewed and tested before being applied. Committing directly to main (A) would be blocked by the branch protection rule. Checking out a development branch (C) is not a standard GitOps practice unless that branch exists and is the designated integration branch. Rebasing main after making changes (D) is a destructive and non-standard workflow that bypasses the review process.
Topics
Community Discussion
No community discussion yet for this question.