Shopify / kubeaudit

kubeaudit helps you audit your Kubernetes clusters against common security controls
MIT License
1.9k stars 184 forks source link

kubeaudit autofix changes some yaml which then fails in yamllint #554

Open arthurzenika opened 1 year ago

arthurzenika commented 1 year ago
ISSUE TYPE

BUG REPORT

SUMMARY

First of all, congrats on kubeaudit autofix, it's a great idea and we're looking forward to using it more.

kubeaudit autofix changes some spacing before comments of section that it is not changing, an example below

image

yamllint is used to verify yaml syntax errors detects this as a problem.

ENVIRONMENT
STEPS TO REPRODUCE

Do kubeaudit autofix on a yaml file that contains a double space followed by a comment # comment here

EXPECTED RESULTS

Ideally kubeaudit would not touch that comment.

ACTUAL RESULTS

The spaces are changed

ADDITIONAL INFORMATION

There is also another case where kubeaudit adds an empty line which is also an error/warning in yamllint

github-actions[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the issue template!