-
Notifications
You must be signed in to change notification settings - Fork 833
-
Notifications
You must be signed in to change notification settings - Fork 833
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
function kubectl() does not work with jsonpath #53
Comments
stozinho
changed the title
Echo command does not work with jsonpath
function kubectl() does not work with jsonpath
Oct 6, 2020
The original kubectl() doesn't work with auto-complete alias as well. Confirmed, adding double quote around fix the issue. |
ChaosMarc
added a commit
to ChaosMarc/kubectl-aliases
that referenced
this issue
Sep 28, 2022
AustralEpitech
pushed a commit
to AustralEpitech/kubectl-aliases
that referenced
this issue
Nov 9, 2022
AustralEpitech
pushed a commit
to AustralEpitech/kubectl-aliases
that referenced
this issue
Jun 18, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(Firstly, credit to the people on the Kubernetes slack who helped me with this!)
So I have been trying to craft a query with jsonpath to find all pods with a certain annotation.
kubectl get pod --all-namespaces -o jsonpath='{range .items[?(@.metadata.annotations.prometheus\.io/scrape=="true")]}{.metadata.name}{"\n"}{end}'
the following line prevents exectution of the above as it appears to strips out the quotes in my command
function kubectl() { echo "+ kubectl $@">&2; command kubectl $@; }
changing the function to the following does work - adding quotes around the shell variables (although what it echoes still removes the quotes).
function kubectl() { echo "+ kubectl $@">&2; command kubectl "$@"; }
The text was updated successfully, but these errors were encountered: