Merge pull request #112024 from cndoit18/remove-redundant-judgment
style: remove redundant judgment
This commit is contained in:
@@ -87,11 +87,7 @@ func validateCSR(obj *certificates.CertificateSigningRequest) error {
|
||||
return err
|
||||
}
|
||||
// check that the signature is valid
|
||||
err = csr.CheckSignature()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return csr.CheckSignature()
|
||||
}
|
||||
|
||||
func validateCertificate(pemData []byte) error {
|
||||
|
@@ -36,9 +36,5 @@ var SortingDeletionAgeRatio = metrics.NewHistogram(
|
||||
|
||||
// Register registers ReplicaSet controller metrics.
|
||||
func Register(registrationFunc func(metrics.Registerable) error) error {
|
||||
err := registrationFunc(SortingDeletionAgeRatio)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return registrationFunc(SortingDeletionAgeRatio)
|
||||
}
|
||||
|
@@ -138,10 +138,7 @@ func (o *ConvertOptions) Complete(f cmdutil.Factory, cmd *cobra.Command) (err er
|
||||
|
||||
// build the printer
|
||||
o.Printer, err = o.PrintFlags.ToPrinter()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
// RunConvert implements the generic Convert command
|
||||
|
@@ -214,10 +214,7 @@ func (m *Stub) Register(kubeletEndpoint, resourceName string, pluginSockDir stri
|
||||
}
|
||||
|
||||
_, err = client.Register(context.Background(), reqt)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
// GetDevicePluginOptions returns DevicePluginOptions settings for the device plugin.
|
||||
|
6
pkg/kubelet/util/cache/object_cache.go
vendored
6
pkg/kubelet/util/cache/object_cache.go
vendored
@@ -77,9 +77,5 @@ func (c *ObjectCache) Get(key string) (interface{}, error) {
|
||||
|
||||
// Add adds objectEntry by using a unique string as the key.
|
||||
func (c *ObjectCache) Add(key string, obj interface{}) error {
|
||||
err := c.cache.Add(objectEntry{key: key, obj: obj})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return c.cache.Add(objectEntry{key: key, obj: obj})
|
||||
}
|
||||
|
@@ -524,11 +524,7 @@ func (ed *emptyDir) teardownDefault(dir string) error {
|
||||
}
|
||||
// Renaming the directory is not required anymore because the operation executor
|
||||
// now handles duplicate operations on the same volume
|
||||
err = os.RemoveAll(dir)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return os.RemoveAll(dir)
|
||||
}
|
||||
|
||||
func (ed *emptyDir) teardownTmpfsOrHugetlbfs(dir string) error {
|
||||
|
Reference in New Issue
Block a user