mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-21 18:11:22 +00:00
Merge pull request #104526 from jingxu97/aug/volumeattach
Fix issue in node status updating VolumeAttached list
This commit is contained in:
@@ -51,6 +51,8 @@ const (
|
||||
// The node is marked as uncertain. The attach operation will fail and return timeout error
|
||||
// for the first attach call. The following call will return sucesssfully.
|
||||
UncertainAttachNode = "uncertain-attach-node"
|
||||
// The detach operation will keep failing on the node.
|
||||
FailDetachNode = "fail-detach-node"
|
||||
// The node is marked as timeout. The attach operation will always fail and return timeout error
|
||||
// but the operation is actually succeeded.
|
||||
TimeoutAttachNode = "timeout-attach-node"
|
||||
@@ -1083,6 +1085,10 @@ func (fv *FakeVolume) Detach(volumeName string, nodeName types.NodeName) error {
|
||||
return fmt.Errorf("trying to detach volume %q that is not attached to the node %q", volumeName, node)
|
||||
}
|
||||
|
||||
if nodeName == FailDetachNode {
|
||||
return fmt.Errorf("fail to detach volume %q to node %q", volumeName, nodeName)
|
||||
}
|
||||
|
||||
volumeNodes.Delete(node)
|
||||
if volumeNodes.Len() == 0 {
|
||||
delete(fv.VolumesAttached, volumeName)
|
||||
|
Reference in New Issue
Block a user