mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
allow resource.version.group in kubectl
This commit is contained in:
@@ -79,9 +79,16 @@ func RunExplain(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []st
|
||||
}
|
||||
|
||||
// TODO: We should deduce the group for a resource by discovering the supported resources at server.
|
||||
gvk, err := mapper.KindFor(unversioned.ParseGroupResource(inModel).WithVersion(""))
|
||||
if err != nil {
|
||||
return err
|
||||
fullySpecifiedGVR, groupResource := unversioned.ParseResourceArg(inModel)
|
||||
gvk := unversioned.GroupVersionKind{}
|
||||
if fullySpecifiedGVR != nil {
|
||||
gvk, _ = mapper.KindFor(*fullySpecifiedGVR)
|
||||
}
|
||||
if gvk.IsEmpty() {
|
||||
gvk, err = mapper.KindFor(groupResource.WithVersion(""))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if len(apiVersionString) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user