mirror of https://github.com/k3s-io/k3s
Merge pull request #59569 from tsmetana/fix-aws-detach
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. AWS: Do not ignore errors from EC2::DescribeVolume in DetachDisk The DetachDisk method of AWS cloudprovider indirectly calls EC2::DescribeVolume AWS API function to check if the volume being detached is really attached to the specified node. The AWS API call may fail and return error which is logged however the DetachDisk then finishes successfully. This may cause the AWS volumes to remain attached to the instances forever because the attach/detach controller will mark the volume as attached. The PV controller will never be able to delete those disks and they need to be detached manually. This patch ensures the error from DescribeVolume is propagated to attach/detach controller and the detach operation is re-tried. cc: @gnufied, @jsafrane ```release-note NONE ```pull/6/head
commit
2172a2a806
|
@ -2013,7 +2013,7 @@ func (c *Cloud) AttachDisk(diskName KubernetesVolumeID, nodeName types.NodeName,
|
|||
// DetachDisk implements Volumes.DetachDisk
|
||||
func (c *Cloud) DetachDisk(diskName KubernetesVolumeID, nodeName types.NodeName) (string, error) {
|
||||
diskInfo, attached, err := c.checkIfAttachedToNode(diskName, nodeName)
|
||||
if diskInfo == nil {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue