mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-09 00:34:10 -04:00
Merge pull request #103454 from dimakow/automated-cherry-pick-of-#102584-upstream-release-1.19
Automated cherry pick of #102584: Fix race in attachdetach tests
This commit is contained in:
commit
514f1d3207
1 changed files with 7 additions and 7 deletions
|
|
@ -59,12 +59,12 @@ func GetTestVolumeSpec(volumeName string, diskName v1.UniqueVolumeName) *volume.
|
|||
}
|
||||
}
|
||||
|
||||
var extraPods *v1.PodList
|
||||
var volumeAttachments *storagev1.VolumeAttachmentList
|
||||
var pvs *v1.PersistentVolumeList
|
||||
var nodes *v1.NodeList
|
||||
|
||||
func CreateTestClient() *fake.Clientset {
|
||||
var extraPods *v1.PodList
|
||||
var volumeAttachments *storagev1.VolumeAttachmentList
|
||||
var pvs *v1.PersistentVolumeList
|
||||
var nodes *v1.NodeList
|
||||
|
||||
fakeClient := &fake.Clientset{}
|
||||
|
||||
extraPods = &v1.PodList{}
|
||||
|
|
@ -156,7 +156,7 @@ func CreateTestClient() *fake.Clientset {
|
|||
// We want also the "mynode" node since all the testing pods live there
|
||||
nodeName = nodeNamePrefix
|
||||
}
|
||||
attachVolumeToNode("lostVolumeName", nodeName)
|
||||
attachVolumeToNode(nodes, "lostVolumeName", nodeName)
|
||||
}
|
||||
fakeClient.AddReactor("update", "nodes", func(action core.Action) (handled bool, ret runtime.Object, err error) {
|
||||
updateAction := action.(core.UpdateAction)
|
||||
|
|
@ -296,7 +296,7 @@ func NewPV(pvName, volumeName string) *v1.PersistentVolume {
|
|||
}
|
||||
}
|
||||
|
||||
func attachVolumeToNode(volumeName, nodeName string) {
|
||||
func attachVolumeToNode(nodes *v1.NodeList, volumeName, nodeName string) {
|
||||
// if nodeName exists, get the object.. if not create node object
|
||||
var node *v1.Node
|
||||
found := false
|
||||
|
|
|
|||
Loading…
Reference in a new issue