mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 01:40:07 +00:00
Add unit tests for MountVolume() of operation executor
This commit is contained in:
parent
d5f7610b82
commit
e7e3c55ad7
@ -154,10 +154,6 @@ func (grm *nestedPendingOperations) IsOperationPending(
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (grm *nestedPendingOperations) GetOperations() []operation {
|
|
||||||
return grm.operations
|
|
||||||
}
|
|
||||||
|
|
||||||
// This is an internal function and caller should acquire and release the lock
|
// This is an internal function and caller should acquire and release the lock
|
||||||
func (grm *nestedPendingOperations) isOperationExists(
|
func (grm *nestedPendingOperations) isOperationExists(
|
||||||
volumeName v1.UniqueVolumeName,
|
volumeName v1.UniqueVolumeName,
|
||||||
|
@ -469,10 +469,6 @@ func (oe *operationExecutor) VerifyControllerAttachedVolume(
|
|||||||
volumeToMount.VolumeName, "" /* podName */, verifyControllerAttachedVolumeFunc)
|
volumeToMount.VolumeName, "" /* podName */, verifyControllerAttachedVolumeFunc)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (oe *operationExecutor) GetNestedPendingOperations() nestedpendingoperations.NestedPendingOperations {
|
|
||||||
return oe.pendingOperations
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: this is a workaround for the unmount device issue caused by gci mounter.
|
// TODO: this is a workaround for the unmount device issue caused by gci mounter.
|
||||||
// In GCI cluster, if gci mounter is used for mounting, the container started by mounter
|
// In GCI cluster, if gci mounter is used for mounting, the container started by mounter
|
||||||
// script will cause additional mounts created in the container. Since these mounts are
|
// script will cause additional mounts created in the container. Since these mounts are
|
||||||
|
@ -54,7 +54,8 @@ func TestOperationExecutor_MountVolume_ParallelMountForNonAttachablePlugins(t *t
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
loop: for {
|
loop:
|
||||||
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ch:
|
case <-ch:
|
||||||
numMountOperationsStarted++
|
numMountOperationsStarted++
|
||||||
@ -93,7 +94,8 @@ func TestOperationExecutor_MountVolume_ParallelMountForAttachablePlugins(t *test
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
loop: for {
|
loop:
|
||||||
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ch:
|
case <-ch:
|
||||||
numMountOperationsStarted++
|
numMountOperationsStarted++
|
||||||
|
Loading…
Reference in New Issue
Block a user