fix nil pointer in create secret commands

Kubernetes-commit: 50015c2da621ecaee581f64f737aa2e527905f14
This commit is contained in:
Ricardo Katz 2021-12-25 21:24:21 -03:00 committed by Kubernetes Publisher
parent d7da6ad9f1
commit 36401bb108
2 changed files with 4 additions and 4 deletions

View File

@ -199,13 +199,13 @@ func (o *CreateSecretOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, ar
o.Namespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
if err != nil {
return nil
return err
}
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
printer, err := o.PrintFlags.ToPrinter()
if err != nil {
return nil
return err
}
o.PrintObj = func(obj runtime.Object) error {

View File

@ -155,13 +155,13 @@ func (o *CreateSecretTLSOptions) Complete(f cmdutil.Factory, cmd *cobra.Command,
o.Namespace, o.EnforceNamespace, err = f.ToRawKubeConfigLoader().Namespace()
if err != nil {
return nil
return err
}
cmdutil.PrintFlagsWithDryRunStrategy(o.PrintFlags, o.DryRunStrategy)
printer, err := o.PrintFlags.ToPrinter()
if err != nil {
return nil
return err
}
o.PrintObj = func(obj runtime.Object) error {