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

Basic usecase doesn't work or is undocumented #3

Open
laurivosandi opened this issue Mar 21, 2024 · 1 comment
Open

Basic usecase doesn't work or is undocumented #3

laurivosandi opened this issue Mar 21, 2024 · 1 comment

Comments

@laurivosandi
Copy link

laurivosandi commented Mar 21, 2024

After spending good 15min+ trying to get it to work I was unable to successfully search secrets and I gave up using kubectl-grep.

Please document what is the equivalent of:

kubectl get secrets -o=jsonpath="{.items[*]}"  | jq '.data | map_values(@base64d)' | grep foobar

I tried following variations but none actually make the relevant entry to pop up:

kubectl get secrets -o=json    | kubectl grep foobar
kubectl get secrets -o=jsonpath="{.items[*]}"  | kubectl grep -nN -r foobar
kubectl get secrets -o=json | kubectl grep -nN -r foobar
kubectl get secrets -o=json -w  | kubectl grep -wnN -r foobar
@howardjohn
Copy link
Owner

kubectl get secrets -oyaml| kubectl grep -d -r foobar should do it. it would output the full secret yaml not just the .data section, so you would also want to pipe it to jq (converting from yaml to json before or using a similar tool with yaml support) to extract just the data value if you want that.

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

No branches or pull requests

2 participants