Change:
func TestExec(t *testing.T) { version := registered.GroupOrDie(api.GroupName).GroupVersion.Version tests := []struct { <del> name, podPath, execPath, container string pod                                *api.Pod execErr                            bool </del> <ins> name, shortPodPath, podPath, execPath, container string pod                                              *api.Pod execErr                                          bool </ins> }{ { <del> name:     "pod exec", podPath:  "/api/" + version + "/namespaces/test/pods/foo", execPath: "/api/" + version + "/namespaces/test/pods/foo/exec", pod:      execPod(), </del> <ins> name:         "pod exec", shortPodPath: "/namespaces/test/pods/foo", podPath:      "/api/" + version + "/namespaces/test/pods/foo", execPath:     "/api/" + version + "/namespaces/test/pods/foo/exec", pod:          execPod(), </ins> }, { <del> name:     "pod exec error", podPath:  "/api/" + version + "/namespaces/test/pods/foo", execPath: "/api/" + version + "/namespaces/test/pods/foo/exec", pod:      execPod(), execErr:  true, </del> <ins> name:         "pod exec error", shortPodPath: "/namespaces/test/pods/foo", podPath:      "/api/" + version + "/namespaces/test/pods/foo", execPath:     "/api/" + version + "/namespaces/test/pods/foo/exec", pod:          execPod(), execErr:      true, </ins> }, } for _, test := range tests {

Discussion:
I feel like I should be able to do: but I get
or we have to do something like this: sounds reasonable to me. needs more comments.
All commands that accept resources should accept resource/NAME syntax. In this case for back compat we must only accept a single argument, is familiar with this.
Exactly. ResourceNames in the resource builder is what is needed here to handle the default resource (pod in this case) and provide the ability to specify more.
Related
If nobody is working on it, I'd like to pick the issue, pls.
I don't think anyone is. , Illia Khudoshyn wrote:
So could you please assign me?
I can't assign to just anyone, unfortunately, but by responding here, anyone else who might work on it will see that you are already in progress. , Illia Khudoshyn wrote:
please go ahead, you did own this now. :)
Has this been reverted again? I cannot use “pod/podname” for v1.11:
^ Seconding the above. I'm getting the same 'may not contain /' error. Naturally it's trivial to use unix commands to filter this, but this is such a basic feature and matches the way the rest of kubectl works, so it's quite a shocking omission.
as a unix novice who's also experiencing this problem, I'd love to know your workaround
If you use selectors, you can do something like this: Otherwise you'll need to manually grep, something like this: is the syntax in bash to run the command and use its output as part of another command. You can also use backticks to achieve the same effect but that's considered bad form by many (myself included). For example: If going the grep route, take care to make sure your regex will only return one result, otherwise you'll have to pipe it to xargs or something similar.
Just ran into this on a brand new default installation. Local Mac Docker for Desktop Enabled k8 in preferences error: invalid resource name "svc/broken-gorilla-postgresql": [may not contain '/']
FWIW you can use combined with the flag, e.g.
Had the same problem. Updating kubectl resolved the issue for me.