style: remove redundant judgment

Signed-off-by: cndoit18 <cndoit18@outlook.com>

Kubernetes-commit: ec43037d0f57fdfc2fdc4960fdb8a7e31ac79fae
This commit is contained in:
cndoit18 2022-07-29 18:25:05 +08:00 committed by Kubernetes Publisher
parent a45fdd19e0
commit c688132ac9
8 changed files with 8 additions and 32 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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) {

View File

@ -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

View File

@ -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.

View File

@ -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