Merge pull request #112024 from cndoit18/remove-redundant-judgment

style: remove redundant judgment
This commit is contained in:
Kubernetes Prow Robot
2022-08-25 07:28:18 -07:00
committed by GitHub
26 changed files with 26 additions and 112 deletions

View File

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

View File

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