cleanup: remove unnecessary import aliases
This commit is contained in:
@@ -27,7 +27,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
corelisters "k8s.io/client-go/listers/core/v1"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
pvutil "k8s.io/component-helpers/storage/volume"
|
||||
"k8s.io/component-helpers/storage/volume"
|
||||
api "k8s.io/kubernetes/pkg/apis/core"
|
||||
pvtesting "k8s.io/kubernetes/pkg/controller/volume/persistentvolume/testing"
|
||||
)
|
||||
@@ -172,10 +172,10 @@ func TestProvisionSync(t *testing.T) {
|
||||
// Provision a volume (with a default class)
|
||||
"11-1 - successful provision with storage class 1",
|
||||
novolumes,
|
||||
newVolumeArray("pvc-uid11-1", "1Gi", "uid11-1", "claim11-1", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classGold, pvutil.AnnBoundByController, pvutil.AnnDynamicallyProvisioned),
|
||||
newVolumeArray("pvc-uid11-1", "1Gi", "uid11-1", "claim11-1", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classGold, volume.AnnBoundByController, volume.AnnDynamicallyProvisioned),
|
||||
newClaimArray("claim11-1", "uid11-1", "1Gi", "", v1.ClaimPending, &classGold),
|
||||
// Binding will be completed in the next syncClaim
|
||||
newClaimArray("claim11-1", "uid11-1", "1Gi", "", v1.ClaimPending, &classGold, pvutil.AnnStorageProvisioner, pvutil.AnnBetaStorageProvisioner),
|
||||
newClaimArray("claim11-1", "uid11-1", "1Gi", "", v1.ClaimPending, &classGold, volume.AnnStorageProvisioner, volume.AnnBetaStorageProvisioner),
|
||||
[]string{"Normal ProvisioningSucceeded"}, noerrors, wrapTestWithProvisionCalls([]provisionCall{provision1Success}, testSyncClaim),
|
||||
},
|
||||
{
|
||||
@@ -194,7 +194,7 @@ func TestProvisionSync(t *testing.T) {
|
||||
novolumes,
|
||||
novolumes,
|
||||
newClaimArray("claim11-3", "uid11-3", "1Gi", "", v1.ClaimPending, &classGold),
|
||||
newClaimArray("claim11-3", "uid11-3", "1Gi", "", v1.ClaimPending, &classGold, pvutil.AnnStorageProvisioner, pvutil.AnnBetaStorageProvisioner),
|
||||
newClaimArray("claim11-3", "uid11-3", "1Gi", "", v1.ClaimPending, &classGold, volume.AnnStorageProvisioner, volume.AnnBetaStorageProvisioner),
|
||||
[]string{"Warning ProvisioningFailed"}, noerrors,
|
||||
wrapTestWithProvisionCalls([]provisionCall{}, testSyncClaim),
|
||||
},
|
||||
@@ -204,7 +204,7 @@ func TestProvisionSync(t *testing.T) {
|
||||
novolumes,
|
||||
novolumes,
|
||||
newClaimArray("claim11-4", "uid11-4", "1Gi", "", v1.ClaimPending, &classGold),
|
||||
newClaimArray("claim11-4", "uid11-4", "1Gi", "", v1.ClaimPending, &classGold, pvutil.AnnStorageProvisioner, pvutil.AnnBetaStorageProvisioner),
|
||||
newClaimArray("claim11-4", "uid11-4", "1Gi", "", v1.ClaimPending, &classGold, volume.AnnStorageProvisioner, volume.AnnBetaStorageProvisioner),
|
||||
[]string{"Warning ProvisioningFailed"}, noerrors,
|
||||
wrapTestWithProvisionCalls([]provisionCall{provision1Error}, testSyncClaim),
|
||||
},
|
||||
@@ -212,9 +212,9 @@ func TestProvisionSync(t *testing.T) {
|
||||
// No provisioning if there is a matching volume available
|
||||
"11-6 - provisioning when there is a volume available",
|
||||
newVolumeArray("volume11-6", "1Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimRetain, classGold),
|
||||
newVolumeArray("volume11-6", "1Gi", "uid11-6", "claim11-6", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classGold, pvutil.AnnBoundByController),
|
||||
newVolumeArray("volume11-6", "1Gi", "uid11-6", "claim11-6", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classGold, volume.AnnBoundByController),
|
||||
newClaimArray("claim11-6", "uid11-6", "1Gi", "", v1.ClaimPending, &classGold),
|
||||
newClaimArray("claim11-6", "uid11-6", "1Gi", "volume11-6", v1.ClaimBound, &classGold, pvutil.AnnBoundByController, pvutil.AnnBindCompleted),
|
||||
newClaimArray("claim11-6", "uid11-6", "1Gi", "volume11-6", v1.ClaimBound, &classGold, volume.AnnBoundByController, volume.AnnBindCompleted),
|
||||
noevents, noerrors,
|
||||
// No provisioning plugin confingure - makes the test fail when
|
||||
// the controller erroneously tries to provision something
|
||||
@@ -225,15 +225,15 @@ func TestProvisionSync(t *testing.T) {
|
||||
// a volume.
|
||||
"11-7 - claim is bound before provisioning",
|
||||
novolumes,
|
||||
newVolumeArray("pvc-uid11-7", "1Gi", "uid11-7", "claim11-7", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classGold, pvutil.AnnBoundByController, pvutil.AnnDynamicallyProvisioned),
|
||||
newVolumeArray("pvc-uid11-7", "1Gi", "uid11-7", "claim11-7", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classGold, volume.AnnBoundByController, volume.AnnDynamicallyProvisioned),
|
||||
newClaimArray("claim11-7", "uid11-7", "1Gi", "", v1.ClaimPending, &classGold),
|
||||
// The claim would be bound in next syncClaim
|
||||
newClaimArray("claim11-7", "uid11-7", "1Gi", "", v1.ClaimPending, &classGold, pvutil.AnnStorageProvisioner, pvutil.AnnBetaStorageProvisioner),
|
||||
newClaimArray("claim11-7", "uid11-7", "1Gi", "", v1.ClaimPending, &classGold, volume.AnnStorageProvisioner, volume.AnnBetaStorageProvisioner),
|
||||
noevents, noerrors,
|
||||
wrapTestWithInjectedOperation(wrapTestWithProvisionCalls([]provisionCall{}, testSyncClaim), func(ctrl *PersistentVolumeController, reactor *pvtesting.VolumeReactor) {
|
||||
// Create a volume before provisionClaimOperation starts.
|
||||
// This similates a parallel controller provisioning the volume.
|
||||
volume := newVolume("pvc-uid11-7", "1Gi", "uid11-7", "claim11-7", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classGold, pvutil.AnnBoundByController, pvutil.AnnDynamicallyProvisioned)
|
||||
volume := newVolume("pvc-uid11-7", "1Gi", "uid11-7", "claim11-7", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classGold, volume.AnnBoundByController, volume.AnnDynamicallyProvisioned)
|
||||
reactor.AddVolume(volume)
|
||||
}),
|
||||
},
|
||||
@@ -242,10 +242,10 @@ func TestProvisionSync(t *testing.T) {
|
||||
// second retry succeeds
|
||||
"11-8 - cannot save provisioned volume",
|
||||
novolumes,
|
||||
newVolumeArray("pvc-uid11-8", "1Gi", "uid11-8", "claim11-8", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classGold, pvutil.AnnBoundByController, pvutil.AnnDynamicallyProvisioned),
|
||||
newVolumeArray("pvc-uid11-8", "1Gi", "uid11-8", "claim11-8", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classGold, volume.AnnBoundByController, volume.AnnDynamicallyProvisioned),
|
||||
newClaimArray("claim11-8", "uid11-8", "1Gi", "", v1.ClaimPending, &classGold),
|
||||
// Binding will be completed in the next syncClaim
|
||||
newClaimArray("claim11-8", "uid11-8", "1Gi", "", v1.ClaimPending, &classGold, pvutil.AnnStorageProvisioner, pvutil.AnnBetaStorageProvisioner),
|
||||
newClaimArray("claim11-8", "uid11-8", "1Gi", "", v1.ClaimPending, &classGold, volume.AnnStorageProvisioner, volume.AnnBetaStorageProvisioner),
|
||||
[]string{"Normal ProvisioningSucceeded"},
|
||||
[]pvtesting.ReactorError{
|
||||
// Inject error to the first
|
||||
@@ -262,7 +262,7 @@ func TestProvisionSync(t *testing.T) {
|
||||
novolumes,
|
||||
novolumes,
|
||||
newClaimArray("claim11-9", "uid11-9", "1Gi", "", v1.ClaimPending, &classGold),
|
||||
newClaimArray("claim11-9", "uid11-9", "1Gi", "", v1.ClaimPending, &classGold, pvutil.AnnStorageProvisioner, pvutil.AnnBetaStorageProvisioner),
|
||||
newClaimArray("claim11-9", "uid11-9", "1Gi", "", v1.ClaimPending, &classGold, volume.AnnStorageProvisioner, volume.AnnBetaStorageProvisioner),
|
||||
[]string{"Warning ProvisioningFailed"},
|
||||
[]pvtesting.ReactorError{
|
||||
// Inject error to five kubeclient.PersistentVolumes.Create()
|
||||
@@ -287,7 +287,7 @@ func TestProvisionSync(t *testing.T) {
|
||||
novolumes,
|
||||
novolumes,
|
||||
newClaimArray("claim11-10", "uid11-10", "1Gi", "", v1.ClaimPending, &classGold),
|
||||
newClaimArray("claim11-10", "uid11-10", "1Gi", "", v1.ClaimPending, &classGold, pvutil.AnnStorageProvisioner, pvutil.AnnBetaStorageProvisioner),
|
||||
newClaimArray("claim11-10", "uid11-10", "1Gi", "", v1.ClaimPending, &classGold, volume.AnnStorageProvisioner, volume.AnnBetaStorageProvisioner),
|
||||
[]string{"Warning ProvisioningFailed", "Warning ProvisioningCleanupFailed"},
|
||||
[]pvtesting.ReactorError{
|
||||
// Inject error to five kubeclient.PersistentVolumes.Create()
|
||||
@@ -308,7 +308,7 @@ func TestProvisionSync(t *testing.T) {
|
||||
novolumes,
|
||||
novolumes,
|
||||
newClaimArray("claim11-11", "uid11-11", "1Gi", "", v1.ClaimPending, &classGold),
|
||||
newClaimArray("claim11-11", "uid11-11", "1Gi", "", v1.ClaimPending, &classGold, pvutil.AnnStorageProvisioner, pvutil.AnnBetaStorageProvisioner),
|
||||
newClaimArray("claim11-11", "uid11-11", "1Gi", "", v1.ClaimPending, &classGold, volume.AnnStorageProvisioner, volume.AnnBetaStorageProvisioner),
|
||||
[]string{"Warning ProvisioningFailed", "Warning ProvisioningCleanupFailed"},
|
||||
[]pvtesting.ReactorError{
|
||||
// Inject error to five kubeclient.PersistentVolumes.Create()
|
||||
@@ -338,7 +338,7 @@ func TestProvisionSync(t *testing.T) {
|
||||
novolumes,
|
||||
novolumes,
|
||||
newClaimArray("claim11-12", "uid11-12", "1Gi", "", v1.ClaimPending, &classGold),
|
||||
newClaimArray("claim11-12", "uid11-12", "1Gi", "", v1.ClaimPending, &classGold, pvutil.AnnStorageProvisioner, pvutil.AnnBetaStorageProvisioner),
|
||||
newClaimArray("claim11-12", "uid11-12", "1Gi", "", v1.ClaimPending, &classGold, volume.AnnStorageProvisioner, volume.AnnBetaStorageProvisioner),
|
||||
[]string{"Warning ProvisioningFailed"},
|
||||
[]pvtesting.ReactorError{
|
||||
// Inject error to five kubeclient.PersistentVolumes.Create()
|
||||
@@ -363,10 +363,10 @@ func TestProvisionSync(t *testing.T) {
|
||||
// Provision a volume (with non-default class)
|
||||
"11-13 - successful provision with storage class 2",
|
||||
novolumes,
|
||||
newVolumeArray("pvc-uid11-13", "1Gi", "uid11-13", "claim11-13", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classSilver, pvutil.AnnBoundByController, pvutil.AnnDynamicallyProvisioned),
|
||||
newVolumeArray("pvc-uid11-13", "1Gi", "uid11-13", "claim11-13", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classSilver, volume.AnnBoundByController, volume.AnnDynamicallyProvisioned),
|
||||
newClaimArray("claim11-13", "uid11-13", "1Gi", "", v1.ClaimPending, &classSilver),
|
||||
// Binding will be completed in the next syncClaim
|
||||
newClaimArray("claim11-13", "uid11-13", "1Gi", "", v1.ClaimPending, &classSilver, pvutil.AnnStorageProvisioner, pvutil.AnnBetaStorageProvisioner),
|
||||
newClaimArray("claim11-13", "uid11-13", "1Gi", "", v1.ClaimPending, &classSilver, volume.AnnStorageProvisioner, volume.AnnBetaStorageProvisioner),
|
||||
[]string{"Normal ProvisioningSucceeded"}, noerrors, wrapTestWithProvisionCalls([]provisionCall{provision2Success}, testSyncClaim),
|
||||
},
|
||||
{
|
||||
@@ -402,8 +402,8 @@ func TestProvisionSync(t *testing.T) {
|
||||
novolumes,
|
||||
novolumes,
|
||||
newClaimArray("claim11-17", "uid11-17", "1Gi", "", v1.ClaimPending, &classExternal),
|
||||
claimWithAnnotation(pvutil.AnnBetaStorageProvisioner, "vendor.com/my-volume",
|
||||
claimWithAnnotation(pvutil.AnnStorageProvisioner, "vendor.com/my-volume",
|
||||
claimWithAnnotation(volume.AnnBetaStorageProvisioner, "vendor.com/my-volume",
|
||||
claimWithAnnotation(volume.AnnStorageProvisioner, "vendor.com/my-volume",
|
||||
newClaimArray("claim11-17", "uid11-17", "1Gi", "", v1.ClaimPending, &classExternal))),
|
||||
[]string{"Normal ExternalProvisioning"},
|
||||
noerrors, wrapTestWithProvisionCalls([]provisionCall{}, testSyncClaim),
|
||||
@@ -433,7 +433,7 @@ func TestProvisionSync(t *testing.T) {
|
||||
// end of the test is empty.
|
||||
novolumes,
|
||||
newClaimArray("claim11-19", "uid11-19", "1Gi", "", v1.ClaimPending, &classGold),
|
||||
newClaimArray("claim11-19", "uid11-19", "1Gi", "", v1.ClaimPending, &classGold, pvutil.AnnStorageProvisioner, pvutil.AnnBetaStorageProvisioner),
|
||||
newClaimArray("claim11-19", "uid11-19", "1Gi", "", v1.ClaimPending, &classGold, volume.AnnStorageProvisioner, volume.AnnBetaStorageProvisioner),
|
||||
noevents,
|
||||
[]pvtesting.ReactorError{
|
||||
// Inject errors to simulate crashed API server during
|
||||
@@ -454,7 +454,7 @@ func TestProvisionSync(t *testing.T) {
|
||||
novolumes,
|
||||
novolumes,
|
||||
newClaimArray("claim11-20", "uid11-20", "1Gi", "", v1.ClaimPending, &classUnsupportedMountOptions),
|
||||
newClaimArray("claim11-20", "uid11-20", "1Gi", "", v1.ClaimPending, &classUnsupportedMountOptions, pvutil.AnnStorageProvisioner, pvutil.AnnBetaStorageProvisioner),
|
||||
newClaimArray("claim11-20", "uid11-20", "1Gi", "", v1.ClaimPending, &classUnsupportedMountOptions, volume.AnnStorageProvisioner, volume.AnnBetaStorageProvisioner),
|
||||
// Expect event to be prefixed with "Mount options" because saving PV will fail anyway
|
||||
[]string{"Warning ProvisioningFailed Mount options"},
|
||||
noerrors, wrapTestWithProvisionCalls([]provisionCall{}, testSyncClaim),
|
||||
@@ -469,9 +469,9 @@ func TestProvisionSync(t *testing.T) {
|
||||
annotateClaim(
|
||||
newClaim("claim11-21", "uid11-21", "1Gi", "", v1.ClaimPending, &classGold),
|
||||
map[string]string{
|
||||
pvutil.AnnStorageProvisioner: "vendor.com/MockCSIDriver",
|
||||
pvutil.AnnBetaStorageProvisioner: "vendor.com/MockCSIDriver",
|
||||
pvutil.AnnMigratedTo: "vendor.com/MockCSIDriver",
|
||||
volume.AnnStorageProvisioner: "vendor.com/MockCSIDriver",
|
||||
volume.AnnBetaStorageProvisioner: "vendor.com/MockCSIDriver",
|
||||
volume.AnnMigratedTo: "vendor.com/MockCSIDriver",
|
||||
}),
|
||||
},
|
||||
[]string{"Normal ExternalProvisioning"},
|
||||
@@ -482,9 +482,9 @@ func TestProvisionSync(t *testing.T) {
|
||||
// in this case, NO normal event with external provisioner should be issued
|
||||
"11-22 - external provisioner with volume available",
|
||||
newVolumeArray("volume11-22", "1Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimRetain, classExternal),
|
||||
newVolumeArray("volume11-22", "1Gi", "uid11-22", "claim11-22", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classExternal, pvutil.AnnBoundByController),
|
||||
newVolumeArray("volume11-22", "1Gi", "uid11-22", "claim11-22", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classExternal, volume.AnnBoundByController),
|
||||
newClaimArray("claim11-22", "uid11-22", "1Gi", "", v1.ClaimPending, &classExternal),
|
||||
newClaimArray("claim11-22", "uid11-22", "1Gi", "volume11-22", v1.ClaimBound, &classExternal, pvutil.AnnBoundByController, pvutil.AnnBindCompleted),
|
||||
newClaimArray("claim11-22", "uid11-22", "1Gi", "volume11-22", v1.ClaimBound, &classExternal, volume.AnnBoundByController, volume.AnnBindCompleted),
|
||||
noevents,
|
||||
noerrors, wrapTestWithProvisionCalls([]provisionCall{}, testSyncClaim),
|
||||
},
|
||||
@@ -494,12 +494,12 @@ func TestProvisionSync(t *testing.T) {
|
||||
newVolumeArray("volume11-23", "1Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimDelete, classCopper),
|
||||
[]*v1.PersistentVolume{
|
||||
newVolume("volume11-23", "1Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimDelete, classCopper),
|
||||
newVolume("pvc-uid11-23", "1Gi", "uid11-23", "claim11-23", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classCopper, pvutil.AnnDynamicallyProvisioned, pvutil.AnnBoundByController),
|
||||
newVolume("pvc-uid11-23", "1Gi", "uid11-23", "claim11-23", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classCopper, volume.AnnDynamicallyProvisioned, volume.AnnBoundByController),
|
||||
},
|
||||
claimWithAnnotation(pvutil.AnnSelectedNode, "node1",
|
||||
claimWithAnnotation(volume.AnnSelectedNode, "node1",
|
||||
newClaimArray("claim11-23", "uid11-23", "1Gi", "", v1.ClaimPending, &classCopper)),
|
||||
claimWithAnnotation(pvutil.AnnSelectedNode, "node1",
|
||||
newClaimArray("claim11-23", "uid11-23", "1Gi", "", v1.ClaimPending, &classCopper, pvutil.AnnStorageProvisioner, pvutil.AnnBetaStorageProvisioner)),
|
||||
claimWithAnnotation(volume.AnnSelectedNode, "node1",
|
||||
newClaimArray("claim11-23", "uid11-23", "1Gi", "", v1.ClaimPending, &classCopper, volume.AnnStorageProvisioner, volume.AnnBetaStorageProvisioner)),
|
||||
[]string{"Normal ProvisioningSucceeded"},
|
||||
noerrors,
|
||||
wrapTestWithInjectedOperation(wrapTestWithProvisionCalls([]provisionCall{provision1Success}, testSyncClaim),
|
||||
@@ -515,11 +515,11 @@ func TestProvisionSync(t *testing.T) {
|
||||
"11-24 - skip finding PV and wait external provisioner for PVC annotated with AnnSelectedNode",
|
||||
newVolumeArray("volume11-24", "1Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimDelete, classExternalWait),
|
||||
newVolumeArray("volume11-24", "1Gi", "", "", v1.VolumeAvailable, v1.PersistentVolumeReclaimDelete, classExternalWait),
|
||||
claimWithAnnotation(pvutil.AnnSelectedNode, "node1",
|
||||
claimWithAnnotation(volume.AnnSelectedNode, "node1",
|
||||
newClaimArray("claim11-24", "uid11-24", "1Gi", "", v1.ClaimPending, &classExternalWait)),
|
||||
claimWithAnnotation(pvutil.AnnBetaStorageProvisioner, "vendor.com/my-volume-wait",
|
||||
claimWithAnnotation(pvutil.AnnStorageProvisioner, "vendor.com/my-volume-wait",
|
||||
claimWithAnnotation(pvutil.AnnSelectedNode, "node1",
|
||||
claimWithAnnotation(volume.AnnBetaStorageProvisioner, "vendor.com/my-volume-wait",
|
||||
claimWithAnnotation(volume.AnnStorageProvisioner, "vendor.com/my-volume-wait",
|
||||
claimWithAnnotation(volume.AnnSelectedNode, "node1",
|
||||
newClaimArray("claim11-24", "uid11-24", "1Gi", "", v1.ClaimPending, &classExternalWait)))),
|
||||
[]string{"Normal ExternalProvisioning"},
|
||||
noerrors, testSyncClaim,
|
||||
@@ -541,9 +541,9 @@ func TestProvisionSync(t *testing.T) {
|
||||
"11-26 - csi with data source",
|
||||
novolumes,
|
||||
novolumes,
|
||||
claimWithAnnotation(pvutil.AnnStorageProvisioner, "mydriver.csi.k8s.io",
|
||||
claimWithAnnotation(volume.AnnStorageProvisioner, "mydriver.csi.k8s.io",
|
||||
claimWithDataSource("test-snap", "VolumeSnapshot", "snapshot.storage.k8s.io", newClaimArray("claim11-26", "uid11-26", "1Gi", "", v1.ClaimPending, &classCSI))),
|
||||
claimWithAnnotation(pvutil.AnnStorageProvisioner, "mydriver.csi.k8s.io",
|
||||
claimWithAnnotation(volume.AnnStorageProvisioner, "mydriver.csi.k8s.io",
|
||||
claimWithDataSource("test-snap", "VolumeSnapshot", "snapshot.storage.k8s.io", newClaimArray("claim11-26", "uid11-26", "1Gi", "", v1.ClaimPending, &classCSI))),
|
||||
[]string{"Normal ExternalProvisioning"},
|
||||
noerrors, wrapTestWithProvisionCalls([]provisionCall{}, testSyncClaim),
|
||||
@@ -572,20 +572,20 @@ func TestProvisionMultiSync(t *testing.T) {
|
||||
// Provision a volume with binding
|
||||
"12-1 - successful provision",
|
||||
novolumes,
|
||||
newVolumeArray("pvc-uid12-1", "1Gi", "uid12-1", "claim12-1", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classGold, pvutil.AnnBoundByController, pvutil.AnnDynamicallyProvisioned),
|
||||
newVolumeArray("pvc-uid12-1", "1Gi", "uid12-1", "claim12-1", v1.VolumeBound, v1.PersistentVolumeReclaimDelete, classGold, volume.AnnBoundByController, volume.AnnDynamicallyProvisioned),
|
||||
newClaimArray("claim12-1", "uid12-1", "1Gi", "", v1.ClaimPending, &classGold),
|
||||
newClaimArray("claim12-1", "uid12-1", "1Gi", "pvc-uid12-1", v1.ClaimBound, &classGold, pvutil.AnnBoundByController, pvutil.AnnBindCompleted, pvutil.AnnStorageProvisioner, pvutil.AnnBetaStorageProvisioner),
|
||||
newClaimArray("claim12-1", "uid12-1", "1Gi", "pvc-uid12-1", v1.ClaimBound, &classGold, volume.AnnBoundByController, volume.AnnBindCompleted, volume.AnnStorageProvisioner, volume.AnnBetaStorageProvisioner),
|
||||
noevents, noerrors, wrapTestWithProvisionCalls([]provisionCall{provision1Success}, testSyncClaim),
|
||||
},
|
||||
{
|
||||
// provision a volume (external provisioner) and binding + normal event with external provisioner
|
||||
"12-2 - external provisioner with volume provisioned success",
|
||||
novolumes,
|
||||
newVolumeArray("pvc-uid12-2", "1Gi", "uid12-2", "claim12-2", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classExternal, pvutil.AnnBoundByController),
|
||||
newVolumeArray("pvc-uid12-2", "1Gi", "uid12-2", "claim12-2", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classExternal, volume.AnnBoundByController),
|
||||
newClaimArray("claim12-2", "uid12-2", "1Gi", "", v1.ClaimPending, &classExternal),
|
||||
claimWithAnnotation(pvutil.AnnBetaStorageProvisioner, "vendor.com/my-volume",
|
||||
claimWithAnnotation(pvutil.AnnStorageProvisioner, "vendor.com/my-volume",
|
||||
newClaimArray("claim12-2", "uid12-2", "1Gi", "pvc-uid12-2", v1.ClaimBound, &classExternal, pvutil.AnnBoundByController, pvutil.AnnBindCompleted))),
|
||||
claimWithAnnotation(volume.AnnBetaStorageProvisioner, "vendor.com/my-volume",
|
||||
claimWithAnnotation(volume.AnnStorageProvisioner, "vendor.com/my-volume",
|
||||
newClaimArray("claim12-2", "uid12-2", "1Gi", "pvc-uid12-2", v1.ClaimBound, &classExternal, volume.AnnBoundByController, volume.AnnBindCompleted))),
|
||||
[]string{"Normal ExternalProvisioning"},
|
||||
noerrors,
|
||||
wrapTestWithInjectedOperation(wrapTestWithProvisionCalls([]provisionCall{}, testSyncClaim), func(ctrl *PersistentVolumeController, reactor *pvtesting.VolumeReactor) {
|
||||
@@ -609,8 +609,8 @@ func TestProvisionMultiSync(t *testing.T) {
|
||||
novolumes,
|
||||
novolumes,
|
||||
newClaimArray("claim12-3", "uid12-3", "1Gi", "", v1.ClaimPending, &classExternal),
|
||||
claimWithAnnotation(pvutil.AnnBetaStorageProvisioner, "vendor.com/my-volume",
|
||||
claimWithAnnotation(pvutil.AnnStorageProvisioner, "vendor.com/my-volume",
|
||||
claimWithAnnotation(volume.AnnBetaStorageProvisioner, "vendor.com/my-volume",
|
||||
claimWithAnnotation(volume.AnnStorageProvisioner, "vendor.com/my-volume",
|
||||
newClaimArray("claim12-3", "uid12-3", "1Gi", "", v1.ClaimPending, &classExternal))),
|
||||
[]string{"Normal ExternalProvisioning"},
|
||||
noerrors,
|
||||
@@ -620,11 +620,11 @@ func TestProvisionMultiSync(t *testing.T) {
|
||||
// provision a volume (external provisioner) and binding + normal event with external provisioner
|
||||
"12-4 - external provisioner with volume provisioned/bound success",
|
||||
novolumes,
|
||||
newVolumeArray("pvc-uid12-4", "1Gi", "uid12-4", "claim12-4", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classExternal, pvutil.AnnBoundByController),
|
||||
newVolumeArray("pvc-uid12-4", "1Gi", "uid12-4", "claim12-4", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classExternal, volume.AnnBoundByController),
|
||||
newClaimArray("claim12-4", "uid12-4", "1Gi", "", v1.ClaimPending, &classExternal),
|
||||
claimWithAnnotation(pvutil.AnnBetaStorageProvisioner, "vendor.com/my-volume",
|
||||
claimWithAnnotation(pvutil.AnnStorageProvisioner, "vendor.com/my-volume",
|
||||
newClaimArray("claim12-4", "uid12-4", "1Gi", "pvc-uid12-4", v1.ClaimBound, &classExternal, pvutil.AnnBoundByController, pvutil.AnnBindCompleted))),
|
||||
claimWithAnnotation(volume.AnnBetaStorageProvisioner, "vendor.com/my-volume",
|
||||
claimWithAnnotation(volume.AnnStorageProvisioner, "vendor.com/my-volume",
|
||||
newClaimArray("claim12-4", "uid12-4", "1Gi", "pvc-uid12-4", v1.ClaimBound, &classExternal, volume.AnnBoundByController, volume.AnnBindCompleted))),
|
||||
[]string{"Normal ExternalProvisioning"},
|
||||
noerrors,
|
||||
wrapTestWithInjectedOperation(wrapTestWithProvisionCalls([]provisionCall{}, testSyncClaim), func(ctrl *PersistentVolumeController, reactor *pvtesting.VolumeReactor) {
|
||||
@@ -636,7 +636,7 @@ func TestProvisionMultiSync(t *testing.T) {
|
||||
// is working on provisioning the PV, also add the operation start timestamp into local cache
|
||||
// operationTimestamps. Rely on the existences of the start time stamp to create a PV for binding
|
||||
if ctrl.operationTimestamps.Has("default/claim12-4") {
|
||||
volume := newVolume("pvc-uid12-4", "1Gi", "uid12-4", "claim12-4", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classExternal, pvutil.AnnBoundByController)
|
||||
volume := newVolume("pvc-uid12-4", "1Gi", "uid12-4", "claim12-4", v1.VolumeBound, v1.PersistentVolumeReclaimRetain, classExternal, volume.AnnBoundByController)
|
||||
ctrl.volumes.store.Add(volume) // add the volume to controller
|
||||
reactor.AddVolume(volume)
|
||||
}
|
||||
|
Reference in New Issue
Block a user