Closed tvandinther closed 1 month ago
This issue is currently awaiting triage.
SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted
label.
The triage/accepted
label can be added by org members by writing /triage accepted
in a comment.
It turns out the single quotes aren't necessary and when removed the quoted command words. Although the help message specifies that these are required in the syntax. I am unsure why the differences.
Isn't this issue trying to achieve similar behavior with https://github.com/kubernetes/kubernetes/issues/127073?.
I think the difficulty may have been averted with a different error message. There seems to be something wrong with it:
error: unexpected path string, expected a 'name1.name2' or '.name1.name2' or '{name1.name2}' or '{.name1.name2}'
It has duplicate options for:
'name1.name2'
'{name1.name2}'
What it should probably cover (and perhaps, what it is trying to say) is:
'name1.name2'
'{name1.name2}'
name1.name2
{name1.name2}
The duplicate of each syntax format has single quotes but should not have them.
I think it tries to enumerate;
name1.name2
.name1.name2
{name1.name2}
{.name1.name2}
quotes in warning message is just to emphasize the valueI see, I did not spot those leading dots. The help examples for wait
have a variation of usage of the single quotes, but not one for if the whole argument is quoted. This is okay, but if you quote the argument, single-quoting like in the example will be parsed differently.
OK: kubectl wait --for=jsonpath='{.status.phase}'=Running pod/busybox1
Not OK: kubectl wait "--for=jsonpath='{.status.phase}'=Running" pod/busybox1
OK: kubectl wait "--for=jsonpath={.status.phase}=Running" pod/busybox1
Hopefully this distinction will help anyone else that gets this error and finds this issue.
What happened: The parsing of this command seems to be affected by quoting the argument.
What you expected to happen:
just as the following unquoted example:
From my understanding, this should not affect things.
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?: Some tools that manage subprocess always execute arguments as these quoted variants which makes the
kubectl wait
command fail with the error shown above.Environment:
kubectl version
):1.30.2
cat /etc/os-release
): Ubuntu linux BASH or sh, or any other shell I've tried (zsh, nu, etc.)