Merge pull request #78257 from gnufied/fix-uncertain-timeout-attach-flake

Fix flake associated with time out volumes
k3s-v1.15.3
Kubernetes Prow Robot 2019-05-23 14:48:33 -07:00 committed by GitHub
commit 01f6e684b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -907,6 +907,11 @@ func (fv *FakeVolume) Attach(spec *Spec, nodeName types.NodeName) (string, error
if nodeName == UncertainAttachNode {
return "/dev/vdb-test", nil
}
// even if volume was previously attached to time out, we need to keep returning error
// so as reconciler can not confirm this volume as attached.
if nodeName == TimeoutAttachNode {
return "", fmt.Errorf("Timed out to attach volume %q to node %q", volumeName, nodeName)
}
if volumeNode == nodeName || volumeNode == MultiAttachNode || nodeName == MultiAttachNode {
return "/dev/vdb-test", nil
}