mirror of https://github.com/k3s-io/k3s
Fix detached-check logic, warn on multiple attachments
parent
3689bf0298
commit
0101bf2081
|
@ -784,13 +784,20 @@ func (self *awsDisk) waitForAttachmentStatus(status string) error {
|
|||
if len(info.Attachments) > 1 {
|
||||
glog.Warningf("Found multiple attachments for volume: %v", info)
|
||||
}
|
||||
attachmentStatus := "detached"
|
||||
attachmentStatus := ""
|
||||
for _, attachment := range info.Attachments {
|
||||
if attachment.Status == status {
|
||||
return nil
|
||||
if attachmentStatus != "" {
|
||||
glog.Warning("Found multiple attachments: ", info)
|
||||
}
|
||||
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)
|
||||
|
||||
attempt++
|
||||
|
|
Loading…
Reference in New Issue