add Local and Unstructured builder attributes

Moves DisabledClientMapperForMapping wrapper to new Local attribute.
Removes Factory#NewUnstructuredBuilder in favor of new Unstructured
builder attribute.
This commit is contained in:
juanvallejo
2017-08-02 16:23:07 -04:00
parent c10f4f78bc
commit 90d76adb4b
39 changed files with 143 additions and 157 deletions

View File

@@ -122,12 +122,13 @@ func (o *SetLastAppliedOptions) Complete(f cmdutil.Factory, cmd *cobra.Command)
}
func (o *SetLastAppliedOptions) Validate(f cmdutil.Factory, cmd *cobra.Command) error {
builder, err := f.NewUnstructuredBuilder(true)
mapper, typer, err := f.UnstructuredObject()
if err != nil {
return err
}
r := builder.
r := f.NewBuilder().
Unstructured(f.UnstructuredClientForMapping, mapper, typer).
NamespaceParam(o.Namespace).DefaultNamespace().
FilenameParam(o.EnforceNamespace, &o.FilenameOptions).
Latest().