mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
generated: refactor
This commit is contained in:
@@ -22,11 +22,11 @@ import (
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||
"k8s.io/kubernetes/pkg/kubectl"
|
||||
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
|
||||
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
|
||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -72,7 +72,7 @@ func RunExplain(f cmdutil.Factory, out, cmdErr io.Writer, cmd *cobra.Command, ar
|
||||
|
||||
recursive := cmdutil.GetFlagBool(cmd, "recursive")
|
||||
apiVersionString := cmdutil.GetFlagString(cmd, "api-version")
|
||||
apiVersion := unversioned.GroupVersion{}
|
||||
apiVersion := schema.GroupVersion{}
|
||||
|
||||
mapper, _ := f.Object()
|
||||
// TODO: After we figured out the new syntax to separate group and resource, allow
|
||||
@@ -84,8 +84,8 @@ func RunExplain(f cmdutil.Factory, out, cmdErr io.Writer, cmd *cobra.Command, ar
|
||||
}
|
||||
|
||||
// TODO: We should deduce the group for a resource by discovering the supported resources at server.
|
||||
fullySpecifiedGVR, groupResource := unversioned.ParseResourceArg(inModel)
|
||||
gvk := unversioned.GroupVersionKind{}
|
||||
fullySpecifiedGVR, groupResource := schema.ParseResourceArg(inModel)
|
||||
gvk := schema.GroupVersionKind{}
|
||||
if fullySpecifiedGVR != nil {
|
||||
gvk, _ = mapper.KindFor(*fullySpecifiedGVR)
|
||||
}
|
||||
@@ -104,7 +104,7 @@ func RunExplain(f cmdutil.Factory, out, cmdErr io.Writer, cmd *cobra.Command, ar
|
||||
apiVersion = groupMeta.GroupVersion
|
||||
|
||||
} else {
|
||||
apiVersion, err = unversioned.ParseGroupVersion(apiVersionString)
|
||||
apiVersion, err = schema.ParseGroupVersion(apiVersionString)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user