Skip to content

Commit

Permalink
Merge pull request #1343 from sunpa93/fix-dynamic-resize-test
Browse files Browse the repository at this point in the history
[V2] bug: address dynamic resizing failure and test storageclass setup
  • Loading branch information
edreed authored May 19, 2022
2 parents 776137e + e53b0d1 commit 48ee115
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions test/e2e/dynamic_provisioning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ func (t *dynamicProvisioningTestSuite) defineTests(isMultiZone bool, schedulerNa
Volume: volume,
Pod: pod,
ResizeOffline: false,
StorageClassParameters: map[string]string{consts.SkuNameField: "Standard_LRS"},
StorageClassParameters: map[string]string{consts.SkuNameField: "StandardSSD_LRS"},
}
test.Run(cs, ns, schedulerName)
})
Expand Down Expand Up @@ -891,7 +891,7 @@ func (t *dynamicProvisioningTestSuite) defineTests(isMultiZone bool, schedulerNa
Volume: volume,
Pod: pod,
ResizeOffline: false,
StorageClassParameters: map[string]string{consts.SkuNameField: "Standard_LRS"},
StorageClassParameters: map[string]string{consts.SkuNameField: "StandardSSD_LRS"},
}
test.Run(cs, ns, schedulerName)
})
Expand Down
10 changes: 5 additions & 5 deletions test/resources/resource_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,24 +257,24 @@ func (pod *PodDetails) SetupDeploymentWithPreProvisionedVolumes(client clientset
func (pod *PodDetails) CreateStorageClass(client clientset.Interface, namespace *v1.Namespace, csiDriver driver.DynamicPVTestDriver, storageClassParameters map[string]string) (storagev1.StorageClass, func()) {
ginkgo.By("setting up the StorageClass")
var allowedTopologyValues []string
var volumeBindingMode storagev1.VolumeBindingMode
var volumeBindingMode *storagev1.VolumeBindingMode

nodes, err := client.CoreV1().Nodes().List(context.TODO(), metav1.ListOptions{})
framework.ExpectNoError(err)
allowedTopologyValuesMap := make(map[string]bool)
for _, node := range nodes.Items {
if zone, ok := node.Labels[testconsts.TopologyKey]; ok {
if zone, ok := node.Labels[testconsts.TopologyKey]; ok && zone != "" {
allowedTopologyValuesMap[zone] = true
}
}
for k := range allowedTopologyValuesMap {
allowedTopologyValues = append(allowedTopologyValues, k)

volumeBindingMode = storagev1.VolumeBindingWaitForFirstConsumer
waitForFirstCustomer := storagev1.VolumeBindingWaitForFirstConsumer
volumeBindingMode = &waitForFirstCustomer
}

reclaimPolicy := v1.PersistentVolumeReclaimDelete
storageClass := csiDriver.GetDynamicProvisionStorageClass(storageClassParameters, []string{}, &reclaimPolicy, &volumeBindingMode, allowedTopologyValues, namespace.Name)
storageClass := csiDriver.GetDynamicProvisionStorageClass(storageClassParameters, []string{}, &reclaimPolicy, volumeBindingMode, allowedTopologyValues, namespace.Name)
tsc := NewTestStorageClass(client, namespace, storageClass)
createdStorageClass := tsc.Create()
return createdStorageClass, tsc.Cleanup
Expand Down

0 comments on commit 48ee115

Please sign in to comment.