simpleMsg,detailedMsg:=volumeToAttach.GenerateMsg("Multi-Attach error","Volume is already exclusively attached to one node and can't be attached to another")
detailedMsg:=volumeToAttach.GenerateMsgDetailed("Multi-Attach error",fmt.Sprintf("Volume is already exclusively attached to node %s and can't be attached to another",nodeList))
glog.Warningf(detailedMsg)
return
}
// There are pods that require the volume and run on another node. Typically
// it's user error, e.g. a ReplicaSet uses a PVC and has >1 replicas. Let
// the user know what pods are blocking the volume.
detailedMsg:=volumeToAttach.GenerateMsgDetailed("Multi-Attach error",fmt.Sprintf("Volume is already used by pods %s on node %s",strings.Join(podNames,", "),strings.Join(otherNodesStr,", ")))
[]string{"Warning FailedAttachVolume Multi-Attach error for volume \"volume-name\" Volume is already exclusively attached to one node and can't be attached to another"},
},
{
"pods in the same namespace use the volume",
[]nodeWithPods{
{"node1",[]string{"ns1/pod1"}},
{"node2",[]string{"ns1/pod2"}},
},
[]string{"Warning FailedAttachVolume Multi-Attach error for volume \"volume-name\" Volume is already used by pod(s) pod2"},
},
{
"pods in anotother namespace use the volume",
[]nodeWithPods{
{"node1",[]string{"ns1/pod1"}},
{"node2",[]string{"ns2/pod2"}},
},
[]string{"Warning FailedAttachVolume Multi-Attach error for volume \"volume-name\" Volume is already used by 1 pod(s) in different namespaces"},
},
{
"pods both in the same and anotother namespace use the volume",
[]nodeWithPods{
{"node1",[]string{"ns1/pod1"}},
{"node2",[]string{"ns2/pod2"}},
{"node3",[]string{"ns1/pod3"}},
},
[]string{"Warning FailedAttachVolume Multi-Attach error for volume \"volume-name\" Volume is already used by pod(s) pod3 and 1 pod(s) in different namespaces"},