Replace yamllint action with make targets, add kyaml mode#705
Replace yamllint action with make targets, add kyaml mode#705
Conversation
7215969 to
3ec4f33
Compare
|
The kyaml linter is documented as not taking any options so if we decide on going through with it then we'll need to adjust the configs a wee bit further. |
aa99b2e to
ade227b
Compare
Drop the ibiqlik/action-yamllint GitHub Action in favour of a plain `make yamllint` invocation. The new target runs yamllint (with -f github for CI annotations) followed by yamlfmt -lint -quiet. Switch yamlfmt to kyaml mode for Kubernetes-native YAML canonicalization. Align exclude lists between .yamllint and .yamlfmt configs, tighten yamllint coverage by removing config/default and config/manager from the ignore list. Co-authored-by: Claude <noreply@anthropic.com>
The file mixed 1-space and 2-space indentation across its two documents. yamllint's spaces: consistent rule catches the mismatch now that config/default is covered. Co-authored-by: Claude <noreply@anthropic.com>
- Add document-start markers (---) to .custom-gcl.yaml, .golangci.yml, .golangci-kal.yml, .mockery.yaml, and config/manager/kustomization.yaml. - Add missing space after # in commented-out YAML blocks in examples/. - Suppress line-length on two unsplittable regex strings in .golangci.yml via yamllint disable-line directives. Co-authored-by: Claude <noreply@anthropic.com>
|
There was a problem hiding this comment.
Pull request overview
Reworks YAML linting/formatting in CI and locally by switching from a dedicated GitHub Action to repository make targets, while standardizing YAML formatting (including enabling yamlfmt’s KYAML mode).
Changes:
- Replace
ibiqlik/action-yamllintwithmake yamllintin the lint workflow and add ayamllintMakefile target that runs bothyamllintandyamlfmt -lint. - Update
yamlfmt/yamllintconfigs and add YAML document-start markers / indentation fixes across various YAML files. - Enable
yamlfmt“kyaml” formatting mode.
Reviewed changes
Copilot reviewed 9 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/cluster.yaml | Reformat commented IPAM examples to match formatter/linter expectations. |
| examples/cluster-cilium.yaml | Same formatting adjustments as examples/cluster.yaml. |
| examples/cluster-calico.yaml | Same formatting adjustments as examples/cluster.yaml. |
| config/manager/kustomization.yaml | Add --- document start marker to satisfy YAML lint/format rules. |
| config/default/webhookcainjection_patch.yaml | Fix indentation under metadata to satisfy YAML formatting/linting. |
| Makefile | Add yamllint target (yamllint + yamlfmt lint) and adjust yamlfmt invocation. |
| .yamllint | Tighten/adjust ignore set and clarify rationale; keeps document-start required. |
| .yamlfmt | Remove include: list, expand scope, and switch formatter type to kyaml. |
| .mockery.yaml | Add --- document start marker. |
| .golangci.yml | Add --- document start marker and line-length suppressions for yamllint. |
| .golangci-kal.yml | Add --- document start marker. |
| .github/workflows/lint.yml | Replace yamllint action usage with make yamllint. |
| .custom-gcl.yaml | Add --- document start marker. |
| - name: Install yamllint | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y yamllint | ||
| - uses: ibiqlik/action-yamllint@2576378a8e339169678f9939646ee3ee325e845c # v3.1.1 | ||
| with: | ||
| format: github | ||
| - run: make yamllint |
There was a problem hiding this comment.
The yamllint job now runs make yamllint, which calls go tool yamlfmt ..., but this job no longer sets up Go. Please add an actions/setup-go step (with go-version-file: go.mod) before running make yamllint to avoid relying on whatever Go happens to be preinstalled on the runner.
| - config/certmanager | ||
| - config/prometheus | ||
| - config/rbac | ||
| - out |
There was a problem hiding this comment.
.yamlfmt no longer restricts/limits which YAML files are processed (the previous include: list is removed) and it does not exclude directories that are explicitly ignored by .yamllint (e.g. .github/workflows, templates, test/e2e). Since make yamllint runs go tool yamlfmt -lint -quiet after yamllint, this can cause CI to fail or format-check files that yamllint intentionally skips. Consider aligning .yamlfmt scope with .yamllint (add matching excludes, or reintroduce an explicit include: list).
| - out | |
| - out | |
| # align with .yamllint ignored paths | |
| - .github/workflows | |
| - templates | |
| - test/e2e |



Description of changes:
Replace
ibiqlik/action-yamllintGitHub Action withmake yamllint. There is no need to use an action (with all its security and maintenance burden) where we have a make target and yamllint can output GitHub annotations.The
yamllintmake target runs bothyamllint(with-f githubwhen in an action) andyamlfmt -lint -quiet(fails if files need formatting).The
yamlfmttarget no longer runsyamlfmttwice,-verboseprints changed files à lago fmt.Enable
yamlfmt's KYAML mode. This might not be acceptable for us just yet.Cleaned up the
yaml{lint,fmt}configs so that they're consistent.Testing performed:
linting and fmting in action and on my machine.
yamllint is failing correctly: we have files with lints that were previously excluded.