diff --git a/pkg/cmd/apply/apply.go b/pkg/cmd/apply/apply.go index 53724a87..c208291c 100644 --- a/pkg/cmd/apply/apply.go +++ b/pkg/cmd/apply/apply.go @@ -250,6 +250,9 @@ func (o *ApplyOptions) Complete(f cmdutil.Factory, cmd *cobra.Command) error { o.OpenAPISchema, _ = f.OpenAPISchema() o.Validator, err = f.Validator(cmdutil.GetFlagBool(cmd, "validate")) + if err != nil { + return err + } o.Builder = f.NewBuilder() o.Mapper, err = f.ToRESTMapper() if err != nil { diff --git a/pkg/cmd/label/label.go b/pkg/cmd/label/label.go index 22d26cb5..6e640246 100644 --- a/pkg/cmd/label/label.go +++ b/pkg/cmd/label/label.go @@ -181,6 +181,9 @@ func (o *LabelOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []st } o.resources = resources o.newLabels, o.removeLabels, err = parseLabels(labelArgs) + if err != nil { + return err + } if o.list && len(o.outputFormat) > 0 { return fmt.Errorf("--list and --output may not be specified together")