kubebuilder icon indicating copy to clipboard operation
kubebuilder copied to clipboard

Add an action for linting the YAML files that are generated during scaffolding

Open everettraven opened this issue 3 years ago • 0 comments
trafficstars

What do you want to happen?

Description: We should add a GitHub Action to run lint checks against the YAML files that are generated as part of scaffolding out a project.

A popular action seems to be: https://github.com/marketplace/actions/yaml-lint

Motivation: Operator-SDK uses a yamllint check as part of the ansible plugin e2e molecule tests and it has failed a few times in the past due to trailing spaces or improper indenting from the YAML files generated by the kustomize plugin. In the past we have gone back and created PRs to fix the scaffolded files, but this becomes tedious to have to do every time we bump the Kubebuilder version we use.

It would be much nicer to have a validation check on Kubebuilder that ensures that the generate YAML passes lint checks that runs on all PRs so we can catch it earlier.

An example of a workaround the ansible plugin has had to implement due to a lint error from the YAML generated by Kubebuilder v3.7.0: https://github.com/operator-framework/operator-sdk/pull/6047#discussion_r995764399

Extra Labels

No response

everettraven avatar Oct 14 '22 14:10 everettraven