Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE_REQUEST] Use .kube-linter.yml in chart directory #533

Open
PascalTurbo opened this issue Apr 6, 2023 · 2 comments
Open

[FEATURE_REQUEST] Use .kube-linter.yml in chart directory #533

PascalTurbo opened this issue Apr 6, 2023 · 2 comments
Labels
question Further information is requested

Comments

@PascalTurbo
Copy link

Description of the problem/feature request
Currently when using a .kube-linter.y(a)ml file, kube-linter searches for this configuration file at the place, where kube-linter is executed. This makes it impossible to use the well-known-configuration file pattern when using kube-linter container image.

Description of the existing behavior vs. expected behavior
.kube-linter.y(a)ml file should be searched for in the path given as linting context.
F.e. kube-linter lint ./my-fancy-helm-chart should search for .kube-linter.y(a)ml in my-fancy-helm-chart path and not in the current path.

@janisz
Copy link
Collaborator

janisz commented Apr 6, 2023

To clarify, you are suggesting that kube-linter should search for the .kube-linter.yaml configuration file in the directory being checked, rather than the directory where kube-linter is executed. However, the current behavior of kube-linter is consistent with other linters like golangci-lint, which also search for the configuration file in the directory where the tool is executed.

To specify a configuration file in a different directory, you need to use the --config flag to provide the path to the configuration file. Keep in mind that changing the behavior of kube-linter could potentially be a breaking change for some users who rely on the current behavior. Therefore, any changes to the behavior of kube-linter should be carefully considered and documented to avoid confusion or unexpected behavior.

@janisz janisz added the question Further information is requested label Apr 6, 2023
@PascalTurbo
Copy link
Author

I think it would be nescessary to remove the current behavior. Just add an additional search path for the .kube-linter.yaml. This shouldn't break anything in most cases.

Alternatively an option for adding more search paths would also be a solution. This differs from the --config option by not failing if file doesn't exist.

The big deal in placing the configure file in the source code folder is, that you can follow convention-over-configuration pattern. If developers needs to configure something, they create a .kube-linter.yaml. If not, they can leave it out.
We f.e. using kube-linter as a tekton task. With the current behavior it is impossible to use the .kube-linter.yaml. The only way is to explicitly configure the configuration path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants