-
Notifications
You must be signed in to change notification settings - Fork 40k
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
allow resource.version.group in kubectl #22853
Conversation
Adding |
Labelling this PR as size/M |
@yifan-gu Have you noticed that rkt test flaking before? |
GCE e2e build/test passed for commit 5bd161a. |
@bgrant0607 @yifan-gu the rkt_test failure is also showing up in #22851. It is trying to do an equality test on 2 arrays of Pods. I wonder if something changed in go 1.5.3? (the build appears to be using that and not 1.4.2) |
@bgrant0607 |
Wow, that was pretty hostile. Did the bot delete my comment? |
Yeah. First github comments, then world domination. |
@lavalamp Please notify me once this is lgtm |
reading it now |
@@ -433,20 +433,36 @@ func (b *Builder) SingleResourceType() *Builder { | |||
return b | |||
} | |||
|
|||
// mappingFor returns the RESTMapping for the Kind referenced by the resource. | |||
// prefers a fully specified GroupVersionResource match. If we don't have one match on GroupResource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: cliffhanger
LGTM, thanks for quick patch. (Don't fix my nit! I want to merge as-is) |
@k8s-oncall @eparis Manually merging |
allow resource.version.group in kubectl
would be nice to add a torture test like this to make sure args parse correctly and map to output versions correctly:
|
Agree, a test is good. @deads2k can you make a follow up? If it turns up On Fri, Mar 11, 2016 at 11:32 AM, Jordan Liggitt notifications@github.com
|
allow resource.version.group in kubectl
This PR is included in #22874 which is slated to be included in the release-1.2 branch. |
allow resource.version.group in kubectl
allow resource.version.group in kubectl
This allows, but does not require,
kubectl get resource.version.group.com
. It does a greedy match on potential versions and compares against the localRESTMapper
for an exact match. If such a match exists it is chosen, if not, then it attempts a partial match assuming justresource.group
. If no group exists, it falls back to old behavior.You lose losing autonegotiation in the case where someone has "group/v1" and "group.v1/v1". It makes usage more painful, but not impossible since greedy on version will prefer "group/v1" for "resource.v1.group", but if you look up the version (or know it), you can ask for "resource.v1.v1.group"
@lavalamp @kubernetes/kubectl @liggitt @smarterclayton @kubernetes/rh-ux