-
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
Discuss what to do with kubectl flags that take in a single api version #22454
Comments
Some options:
|
Related to #14318 |
I could see allowing multiple I see |
I would agree that --api-version=group1/version1,group2/version2 is
what I would expect, rather than a new flag.
|
Do you still want --api-version if we allow users to specify the version with resource? Like |
I think so. Remember that we also have automatic disambiguation of resources based on preferences. I can specify |
Why have 2 ways to do the same thing? Why not write the same command as |
From usability point of view, it would be better to have kubectl get resource1,resources2.. --api-version=group1/version1... when requesting multiple resources in the same group/version pairs. |
Based on discussion with @lavalamp, here is what we can do:
|
Even the end goal for 1.3 still makes this painful for a user. The vast majority of the time users won't have to specify a group. The explicit group disambiguation should be the exception, but being able to specify a preferred version for an API group is also pretty normal to do, especially during transitions. The "normalness" of specifying back when we had three versions was how we ended up with it. Keeping separate settings in a kubeconfig (or other preference file) allows default disambiguation to do its 90%-case job and allows |
Re checking output-version and convert: It works but does not error if the output version value is inapplicable. I created an hpa using Running Running Running So the default for |
Hopefully it's deployments.v1beta1.extensions? @deads2k I make two strange claims. Claim 1: maintaining a list of group-version pairs is actually a worse experience than not. First, I note that all of your config files have a group/version embedded in them. So for any Finally, I believe any script you have to drive kubectl must use fully qualified resource names. Otherwise, it will behave subtly differently depending on whose computer it is run from (in your world with custom lists) or differently depending on the server version/flags (in my world). If you accept that only get/list requests actually need the override, and only from the command line, < 20% of the time, then it seems like keeping a list is a ton of complexity and engineering time consumer that just doesn't add value. In fact I think it's negative value, as users have a level of indirection they have to understand when the system does something they don't expect. Claim 2: output-version should never need to be different than the version we talk to the server. If you need a file in a different format, piping it through kubectl convert seems like a fine solution. --output-version is super confusing when you can do things that act on multiple resources. |
I think I could buy claim 1, but I'd like to have a working implementation go in for the same release where we disable the flag entirely and I think we might want to have different preferred orderings for clients and servers (right now the preferred ordering is static regardless of server or client). I left the option open and made sure that when used in combination with a discovery doc, disambiguation was possible, but I did not plumb it through. I don't think I agree with claim 2. When writing scripts, it is extremely common to use a template to control output. In order for the template to be predictable, you have to pin the output-version. I don't think that always requiring a pipe through to conversion enhances readability in those cases. |
Agree with @deads2k, I always set --output-version when writing a template or jsonpath script |
thing is, I don't really care what it speaks to the server, I just want it to output the version I'm writing my template to |
That's great, then you can use the explicit resource version to do that. |
I think lists of group/version pairs are SUPER CONFUSING. I don't care if we make admins understand them when they set up apiserver. But I'm going to fight as hard as I can to keep us from making every kubectl user from having to understand them. |
I see the version that you use to communicate with server as distinct from the output format you choose, including your template. Why would I tie those two things together? Is it any less confusing to try to understand which flags I pass to |
I maintain that kubectl should not do any conversion. I'd like to move conversion to be server side, actually.
|
Ref #3955 |
It seems like any list and certainly any object that contains another object would cause problems. How would I handle |
What's the equivalent representation in the version you're converting to? On Mon, Mar 7, 2016 at 5:10 AM, David Eads notifications@github.com wrote:
|
Ok, true. I'd still like to keep the flag for the single-version case so I can write stable templates (that seems to still work now) and I'd like to see a replacement for |
Let's discuss this in the next API machinery SIG. On Mon, Mar 7, 2016 at 11:32 AM, David Eads notifications@github.com
|
If this is going to be addressed in 1.2, it needs to be addressed in the next 24 hours. |
I'm punting this out of 1.2, but feel free to argue with me (though do it quickly). |
I don't think we can solve this completely for 1.2. Can we at least deprecate the --api-version flag? |
How much time is left to see what it takes to support |
@deads2k Not much time. I thought it already worked ;-( |
It's possible to do on top, but not done. I'll see what I can put together. |
|
As long as no one makes a group called "v1" or "v1beta1" it should be fine, On Thu, Mar 10, 2016 at 1:42 PM, Jordan Liggitt notifications@github.com
|
You mean losing autonegotiation in the case where someone has "group/v1" and "group.v1/v1"? I'd say it make the situation painful, but not impossible and cluster-admins would really have to hate users to allow it. 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" I don't see the pain around that (very rare) edge as sufficient to avoid this. |
opened #22853 |
If we're really worried about it, we can reject group names based on a regexp. @nikhiljindal Yes. We have til 11... |
Issues go stale after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Problem: We have kubectl flags (--api-version and --output-version) that take an API version. These were designed when we had just one group and it was expected that just specifying the version will be enough.
But, we now have multiple groups with potentially multiple versions in each group. We have replaced version by groupVersion at most places, but these kubectl flags remain.
This issue is to discuss the path forward for these kubectl flags. What we should do in 1.2 and what is post-1.2
cc @bgrant0607 @deads2k @smarterclayton @lavalamp @caesarxuchao @janetkuo @kubernetes/kubectl
The text was updated successfully, but these errors were encountered: