mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Fix GCE attacher/detacher to ignore return value of failed calls.
The plugin should ignore any return value if err is set.
This commit is contained in:
parent
3157e87cb2
commit
eb5a68319e
@ -76,7 +76,7 @@ func (attacher *gcePersistentDiskAttacher) Attach(spec *volume.Spec, hostName st
|
||||
pdName, hostName, err)
|
||||
}
|
||||
|
||||
if attached {
|
||||
if err == nil && attached {
|
||||
// Volume is already attached to node.
|
||||
glog.Infof("Attach operation is successful. PD %q is already attached to node %q.", pdName, hostName)
|
||||
return nil
|
||||
@ -198,7 +198,7 @@ func (detacher *gcePersistentDiskDetacher) Detach(deviceMountPath string, hostNa
|
||||
pdName, hostName, err)
|
||||
}
|
||||
|
||||
if !attached {
|
||||
if err == nil && !attached {
|
||||
// Volume is not attached to node. Success!
|
||||
glog.Infof("Detach operation is successful. PD %q was not attached to node %q.", pdName, hostName)
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user