Skip to content
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

Add API group concept to kubectl #13929

Closed
lavalamp opened this issue Sep 14, 2015 · 15 comments
Closed

Add API group concept to kubectl #13929

lavalamp opened this issue Sep 14, 2015 · 15 comments
Assignees
Labels
area/kubectl priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.

Comments

@lavalamp
Copy link
Member

E.g.:

  • kubectl delete group/resource name
  • kubectl get group/resource name
  • kubectl get resource/name
  • kubectl get resource name

Need to make reasonable assumption about the group when it's not provided?

@lavalamp lavalamp added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. team/ux labels Sep 14, 2015
@lavalamp
Copy link
Member Author

@caesarxuchao @janetkuo

@timothysc
Copy link
Member

/cc @kubernetes/rh-cluster-infra

@janetkuo
Copy link
Member

Do we support these?

  • kubectl operation group/resource
  • kubectl operation group/resource/name
  • kubectl operation group resource
  • kubectl operation group resource name

When the group isn't provided, we assume it's empty or find the first match?

@lavalamp
Copy link
Member Author

I think if group is not provided, then we should see what groups the resource could possibly be inside; if there's only 1, great. If there's more than one, we should error out.

Likewise it shouldn't be ambiguous whether kubectl get a b is group/resource or resource/name, because presumably we won't have groups named e.g. "pods" or resources named e.g. "experimental"; but if we do have those cases, we should force the user to be explicit rather than do something surprising.

I don't have opinions on whether '/', ' ', or both should be allowed as separators.

@lavalamp
Copy link
Member Author

So to do that, kubectl would need to get (or maintain) a map of resource -> (group, resource). We should get that from apiserver, not by looking at the resources compiled into kubelet.

@janetkuo
Copy link
Member

TODOs:

  • make kubectl <operation> group/resource name and kubectl <operation> group/resource work (Support kubectl group/resource name #14461)
  • update kubectl help text for api group
  • kubectl --api-version and --output-version flag should accept values in the form of group/version, and should work as they do today. For multi-resource operations we'll disable these 2 flags.
  • pkg/client: api version to be set at high level, not low level. (pkg/client: api version to be set at high level, not low level. #14133)
    • remove references to "version" from the RESTClient (pkg/client/unversioned#RESTClient)
    • put them in the high level client, adding Group(), Version(), and GroupVersion() calls to the client.Request (pkg/client/unversioned#Request) object
    • store group/version information in resource.Helper (pkg/kubectl/resource#Helper)

@caesarxuchao
Copy link
Member

@janetkuo, just in case you don't know this already, as stated in the proposal:
"When kubectl is used with a single resource type, the --api-version and --output-version flag of kubectl should accept values in the form of group/version, and they should work as they do today. For multi-resource operations, we will disable these two flags initially."

@liggitt
Copy link
Member

liggitt commented Sep 22, 2015

as we think about this, we should also consider whether subresources (which kubectl doesn't support today) should be addressable, and how

@0xmichalis
Copy link
Contributor

@kubernetes/kubectl

@adohe-zz
Copy link

adohe-zz commented Mar 4, 2016

It seems some TODOs still not finished, will pick one.

@nikhiljindal
Copy link
Contributor

We now support resource.version.group for kubectl commands: #22853

#22454 tracks what we should do about --api-version and --output-version.

I guess we can close this issue?

@deads2k
Copy link
Contributor

deads2k commented Mar 14, 2016

I guess we can close this issue?

I think we'll still have problems specifying api-versions for names retrieved from files and for commands that don't take resource strings like cordon as a for instance. We don't use those often downstream, have you guys already figured out what to do about those?

@0xmichalis
Copy link
Contributor

I think cordon can handle resource strings.

@0xmichalis
Copy link
Contributor

Is this still an issue?

@bgrant0607
Copy link
Member

Please file more specific issues for any remaining problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubectl priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Projects
None yet
Development

No branches or pull requests

10 participants