CGOA practice question 13 of 15

You are working on a GitOps project and want to ensure that the configuration files are written in a standardized format. What is the recommended way to ensure this?

Full set: 60 questions
Answer options
A: Ask team members to manually review each other's configuration files for formatting issues.
B: Ignore the formatting issues and focus on the functionality of the configuration files.
C: Use a linter tool to automatically check the configuration files for formatting issues. Correct answer
D: Manually review each configuration file to check for any formatting issues.
Correct Answer:
C. Use a linter tool to automatically check the configuration files for formatting issues.
Explanation

GitOps emphasises automated, repeatable workflows. The Linux Foundation’s “Introduction to GitOps” course and the CNCF GitOps Principles both state that configuration files should be statically validated and formatted by automated tooling (linters/formatters) as part of the CI pipeline. Linters provide consistent, objective checks and can be executed on every commit, guaranteeing that all YAML/JSON/Helm files comply with the agreed-upon style without relying on error-prone manual reviews. Therefore, using a linter tool is the recommended approach.

Why Incorrect

A. Peer reviews help code quality but cannot guarantee uniform formatting; humans are slower and inconsistent compared with automated linting.
B. Ignoring formatting violates GitOps best practices of consistency and continuous verification.
D. Manual per-file inspection is labour-intensive, scales poorly, and is still prone to human error; automation is explicitly recommended instead.

References

1. The Linux Foundation, “LFS169x: Introduction to GitOps”, Module 4 “Automation & Tooling”, slide 12: “Integrate linters/formatters into CI to enforce configuration standards automatically.”

2. CNCF GitOps Working Group, “GitOps Principles v1.0”, Principle 4 (Continuous Verification), ¶3: “Static analysis tools (linters, validators) SHOULD run on every pull request to guarantee declarative configuration correctness.”

3. Kubernetes Documentation, “Static Code Analysis of Kubernetes Manifests”, Section ‘Using kube-linter’, ¶1–2 (https://kubernetes.io/docs/tasks/). States use of linters to “enforce best-practice formatting and detect misconfigurations.”

4. MIT OpenCourseWare 6.005 “Software Construction”, Lecture 7 notes, p.3: “Automated linting enforces style and invariants more effectively than manual code review.”

Scroll to Top