kube-no-trouble icon indicating copy to clipboard operation
kube-no-trouble copied to clipboard

Unable to give multiple manifest files for scanning

Open Kabsuri31 opened this issue 9 months ago • 2 comments

Is there a way we can provide multiple files using -f flag for scanning.

Kabsuri31 avatar Apr 29 '24 09:04 Kabsuri31

I couldn't find docs on how to format multiple names, neither in kube-no-trouble nor in the flags library spf13/pflag that this kubent uses.

But I found you can do this if you want to provide the filenames with -f:

kubent -f file1.yaml,file2.yaml

What I do is this, however:

# The - means STDIN
cat *.yaml |kubent -f -
# Actually I mostly do this, specifically:
cat **/*.yaml | kubent -f

Or if you have a command that generates the YAML, you could put that after the -f if you'd like:

kubent -f <(cat *.yaml)
kubent -f <(cat **/*.yaml)

nicolaiskogheim avatar Jun 17 '24 07:06 nicolaiskogheim

I guess there's this as well:

FILES=($(ls *.yaml)); kubent ${FILES[@]/#/-f} --helm3=false -c=false

but I think that's a bit complicated.

Found here

nicolaiskogheim avatar Jun 17 '24 07:06 nicolaiskogheim

You can pipe too. I feel this issue is fine.

dark0dave avatar Jul 07 '24 16:07 dark0dave