style: remove redundant judgment
Signed-off-by: cndoit18 <cndoit18@outlook.com> Kubernetes-commit: ec43037d0f57fdfc2fdc4960fdb8a7e31ac79fae
This commit is contained in:
parent
a45fdd19e0
commit
c688132ac9
|
@ -74,10 +74,7 @@ func (o *APIVersionsOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, arg
|
|||
}
|
||||
var err error
|
||||
o.discoveryClient, err = f.ToDiscoveryClient()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
// RunAPIVersions does the work
|
||||
|
|
|
@ -211,10 +211,7 @@ func (o *CreateIngressOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, a
|
|||
}
|
||||
|
||||
o.ValidationDirective, err = cmdutil.GetValidationDirective(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
// Validate validates the Ingress object to be created
|
||||
|
|
|
@ -143,10 +143,7 @@ func (o *NamespaceOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args
|
|||
}
|
||||
|
||||
o.ValidationDirective, err = cmdutil.GetValidationDirective(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
// Run calls the CreateSubcommandOptions.Run in NamespaceOpts instance
|
||||
|
|
|
@ -152,10 +152,7 @@ func (o *RoleBindingOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, arg
|
|||
}
|
||||
|
||||
o.ValidationDirective, err = cmdutil.GetValidationDirective(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
// Validate validates required fields are set
|
||||
|
|
|
@ -381,10 +381,7 @@ func (o *ExposeServiceOptions) RunExpose(cmd *cobra.Command, args []string) erro
|
|||
|
||||
return o.PrintObj(actualObject, o.Out)
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
func (o *ExposeServiceOptions) createService() (*corev1.Service, error) {
|
||||
|
|
|
@ -199,10 +199,7 @@ func (o *SetResourcesOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, ar
|
|||
}
|
||||
|
||||
o.Infos, err = builder.Do().Infos()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
// Validate makes sure that provided values in ResourcesOptions are valid
|
||||
|
|
|
@ -174,10 +174,7 @@ func (o *SetServiceAccountOptions) Complete(f cmdutil.Factory, cmd *cobra.Comman
|
|||
Latest()
|
||||
}
|
||||
o.infos, err = builder.Do().Infos()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
// Run creates and applies the patch either locally or calling apiserver.
|
||||
|
|
|
@ -589,10 +589,7 @@ func (o *EditOptions) annotationPatch(update *resource.Info) error {
|
|||
WithFieldValidation(o.ValidationDirective).
|
||||
WithSubresource(o.Subresource)
|
||||
_, err = helper.Patch(o.CmdNamespace, update.Name, patchType, patch, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
// GetApplyPatch is used to get and apply patches
|
||||
|
|
Loading…
Reference in New Issue