kube-linter icon indicating copy to clipboard operation
kube-linter copied to clipboard

[FEATURE_REQUEST] Add `--exclude-paths` option to exclude linting files under those paths

Open asilverman opened this issue 4 years ago • 5 comments

Description of the problem/feature request Our project contains a third_party folder containing yaml files that do not concern us, I would like an option to ignore all files under that path.

Description of the existing behavior vs. expected behavior Currently this is not an option

Additional context N\A

asilverman avatar Feb 02 '21 17:02 asilverman

Hi @asilverman, thanks for filing this issue! To confirm, is your current workflow to run kube-linter lint . at the root of a directory with a lot of files?

viswajithiii avatar Feb 06 '21 21:02 viswajithiii

I'd like to see something like this too, though ideally being able to configure the excluded paths using the .kube-linter.yaml configuration file. In my particular case I have a directory that contains some Kustomization patches as well as some upstream YAMLs; annotating those doesn't make sense (I'd like to avoid modifying the upstream YAML at all) so I'd just like to exclude them.

bootc avatar Jun 05 '21 10:06 bootc

Please add this feature. We also need this. Thank you

schadom avatar Sep 29 '21 08:09 schadom

This feature would be useful to exclude upstream charts for which we don't want to make changes.

rptx avatar Nov 23 '21 10:11 rptx

any progress on this? we need this feature as well...

chrislin22 avatar May 20 '22 17:05 chrislin22

Any updates for this feature, I am looking this option as well.

titanlien avatar Dec 09 '22 11:12 titanlien

Hi @asilverman, thanks for filing this issue! To confirm, is your current workflow to run kube-linter lint . at the root of a directory with a lot of files?

Yes

asilverman avatar Jan 29 '23 05:01 asilverman

Hi @asilverman, thanks for filing this issue! To confirm, is your current workflow to run kube-linter lint . at the root of a directory with a lot of files?

Yes

same here

chrislin22 avatar Jan 30 '23 12:01 chrislin22

I see this was added in v0.6.0 but it doesn't seem to work. Has anyone had any luck with this? I've tried multiple variations of paths in the config and the CLI flag with no prevail.

@titanlien

begs avatar Feb 21 '23 13:02 begs

Hi @begs Did you ever try --ignore-paths in v0.6.0 version? It should work.

titanlien avatar Mar 02 '23 07:03 titanlien

Hi @begs Did you ever try --ignore-paths in v0.6.0 version? It should work.

Hi @titanlien! Yes, I haven't been able to make it work.

$ kube-linter version
0.6.0

I have tried including a path to ignorePaths in the config and with the --ignore-paths flag, but it still shows errors from that path when I run kube-lint lint . from the repository root.

I have tried variations of global and relative path but with no luck. I have been able to exclude checks using the config file though, so it is definitely able to read the config.

There is someone else with the same issue here.

begs avatar Mar 02 '23 08:03 begs

I have tried including a path to ignorePaths in the config and with the --ignore-paths flag, but it still shows errors from that path when I run kube-lint lint . from the repository root.

I have tried variations of global and relative path but with no luck. I have been able to exclude checks using the config file though, so it is definitely able to read the config.

Sounds like this issue is related: https://github.com/stackrox/kube-linter/issues/500 (FYI I've got the same problem, ignorePaths doesn't seem to apply).

wiktor-k avatar Mar 10 '23 11:03 wiktor-k

@janisz Looks like the fix landed with #515. Can we close this issue & cut new bug fix release?

jumbosushi avatar Apr 10 '23 18:04 jumbosushi

Sure, I'm waiting for one more PR and will cut release tomorrow. Thanks for pointing this out.

janisz avatar Apr 10 '23 18:04 janisz