refactor builder in kubectl factory
This commit is contained in:
@@ -116,16 +116,10 @@ func RunDescribe(f cmdutil.Factory, out, cmdErr io.Writer, cmd *cobra.Command, a
|
||||
return cmdutil.UsageErrorf(cmd, "Required resource not specified.")
|
||||
}
|
||||
|
||||
mapper, typer, err := f.UnstructuredObject()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// include the uninitialized objects by default
|
||||
// unless user explicitly set --include-uninitialized=false
|
||||
includeUninitialized := cmdutil.ShouldIncludeUninitialized(cmd, true)
|
||||
r := f.NewBuilder().
|
||||
Unstructured(f.UnstructuredClientForMapping, mapper, typer).
|
||||
r := f.NewUnstructuredBuilder().
|
||||
ContinueOnError().
|
||||
NamespaceParam(cmdNamespace).DefaultNamespace().AllNamespaces(allNamespaces).
|
||||
FilenameParam(enforceNamespace, options).
|
||||
|
Reference in New Issue
Block a user