refactor builder in kubectl factory
This commit is contained in:
@@ -120,13 +120,12 @@ func RunReplace(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []str
|
||||
return fmt.Errorf("--timeout must have --force specified")
|
||||
}
|
||||
|
||||
mapper, typer, err := f.UnstructuredObject()
|
||||
mapper, _, err := f.UnstructuredObject()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
r := f.NewBuilder().
|
||||
Unstructured(f.UnstructuredClientForMapping, mapper, typer).
|
||||
r := f.NewUnstructuredBuilder().
|
||||
Schema(schema).
|
||||
ContinueOnError().
|
||||
NamespaceParam(cmdNamespace).DefaultNamespace().
|
||||
@@ -249,8 +248,7 @@ func forceReplace(f cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []s
|
||||
return err
|
||||
}
|
||||
|
||||
r = f.NewBuilder().
|
||||
Unstructured(f.UnstructuredClientForMapping, mapper, typer).
|
||||
r = f.NewUnstructuredBuilder().
|
||||
Schema(schema).
|
||||
ContinueOnError().
|
||||
NamespaceParam(cmdNamespace).DefaultNamespace().
|
||||
|
Reference in New Issue
Block a user