mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Fix detached-check logic, warn on multiple attachments
This commit is contained in:
parent
3689bf0298
commit
0101bf2081
@ -784,13 +784,20 @@ func (self *awsDisk) waitForAttachmentStatus(status string) error {
|
|||||||
if len(info.Attachments) > 1 {
|
if len(info.Attachments) > 1 {
|
||||||
glog.Warningf("Found multiple attachments for volume: %v", info)
|
glog.Warningf("Found multiple attachments for volume: %v", info)
|
||||||
}
|
}
|
||||||
attachmentStatus := "detached"
|
attachmentStatus := ""
|
||||||
for _, attachment := range info.Attachments {
|
for _, attachment := range info.Attachments {
|
||||||
if attachment.Status == status {
|
if attachmentStatus != "" {
|
||||||
return nil
|
glog.Warning("Found multiple attachments: ", info)
|
||||||
}
|
}
|
||||||
attachmentStatus = attachment.Status
|
attachmentStatus = attachment.Status
|
||||||
}
|
}
|
||||||
|
if attachmentStatus == "" {
|
||||||
|
attachmentStatus = "detached"
|
||||||
|
}
|
||||||
|
if attachmentStatus == status {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
glog.V(2).Infof("Waiting for volume state: actual=%s, desired=%s", attachmentStatus, status)
|
glog.V(2).Infof("Waiting for volume state: actual=%s, desired=%s", attachmentStatus, status)
|
||||||
|
|
||||||
attempt++
|
attempt++
|
||||||
|
Loading…
Reference in New Issue
Block a user