diff --git a/cluster/gce/config-test.sh b/cluster/gce/config-test.sh index a601399b3f5..4bac9cedfe6 100755 --- a/cluster/gce/config-test.sh +++ b/cluster/gce/config-test.sh @@ -368,7 +368,7 @@ if [[ -n "${GCE_GLBC_IMAGE:-}" ]]; then fi if [[ -z "${KUBE_ADMISSION_CONTROL:-}" ]]; then - ADMISSION_CONTROL="NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,PodPreset,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,Priority,StorageObjectInUseProtection" + ADMISSION_CONTROL="NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,PodPreset,DefaultStorageClass,DefaultTolerationSeconds,NodeRestriction,Priority,StorageObjectInUseProtection,PersistentVolumeClaimResize" if [[ "${ENABLE_POD_SECURITY_POLICY:-}" == "true" ]]; then ADMISSION_CONTROL="${ADMISSION_CONTROL},PodSecurityPolicy" fi diff --git a/test/e2e/storage/mounted_volume_resize.go b/test/e2e/storage/mounted_volume_resize.go index 29090f10ec5..656c9df0150 100644 --- a/test/e2e/storage/mounted_volume_resize.go +++ b/test/e2e/storage/mounted_volume_resize.go @@ -35,7 +35,7 @@ import ( "k8s.io/kubernetes/test/e2e/storage/utils" ) -var _ = utils.SIGDescribe("Mounted volume expand[Slow]", func() { +var _ = utils.SIGDescribe("Mounted volume expand", func() { var ( c clientset.Interface ns string diff --git a/test/e2e/storage/volume_expand.go b/test/e2e/storage/volume_expand.go index 2323e26ba1c..5d9486d4a94 100644 --- a/test/e2e/storage/volume_expand.go +++ b/test/e2e/storage/volume_expand.go @@ -40,7 +40,7 @@ const ( totalResizeWaitPeriod = 20 * time.Minute ) -var _ = utils.SIGDescribe("Volume expand [Slow]", func() { +var _ = utils.SIGDescribe("Volume expand", func() { var ( c clientset.Interface ns string @@ -78,9 +78,8 @@ var _ = utils.SIGDescribe("Volume expand [Slow]", func() { It("should not allow expansion of pvcs without AllowVolumeExpansion property", func() { test := testsuites.StorageClassTest{ - Name: "no-expansion", - ClaimSize: "2Gi", - AllowVolumeExpansion: false, + Name: "no-expansion", + ClaimSize: "2Gi", } regularSC, err := createStorageClass(test, ns, "noexpand", c) Expect(err).NotTo(HaveOccurred(), "Error creating non-expandable storage class") @@ -88,9 +87,7 @@ var _ = utils.SIGDescribe("Volume expand [Slow]", func() { defer func() { framework.ExpectNoError(c.StorageV1().StorageClasses().Delete(regularSC.Name, nil)) }() - - Expect(regularSC.AllowVolumeExpansion).NotTo(BeNil()) - Expect(*resizableSc.AllowVolumeExpansion).To(BeFalse()) + Expect(regularSC.AllowVolumeExpansion).To(BeNil()) noExpandPVC := newClaim(test, ns, "noexpand") noExpandPVC.Spec.StorageClassName = ®ularSC.Name @@ -108,7 +105,7 @@ var _ = utils.SIGDescribe("Volume expand [Slow]", func() { By("Expanding non-expandable pvc") newSize := resource.MustParse("6Gi") - pvc, err = expandPVCSize(noExpandPVC, newSize, c) + noExpandPVC, err = expandPVCSize(noExpandPVC, newSize, c) Expect(err).To(HaveOccurred(), "While updating non-expandable PVC") }) diff --git a/test/e2e/storage/volume_provisioning.go b/test/e2e/storage/volume_provisioning.go index 98359d17f9d..0cf1df804c3 100644 --- a/test/e2e/storage/volume_provisioning.go +++ b/test/e2e/storage/volume_provisioning.go @@ -1063,7 +1063,11 @@ func newStorageClass(t testsuites.StorageClassTest, ns string, suffix string) *s if t.DelayBinding { bindingMode = storage.VolumeBindingWaitForFirstConsumer } - return getStorageClass(pluginName, t.Parameters, &bindingMode, ns, suffix) + sc := getStorageClass(pluginName, t.Parameters, &bindingMode, ns, suffix) + if t.AllowVolumeExpansion { + sc.AllowVolumeExpansion = &t.AllowVolumeExpansion + } + return sc } func getStorageClass(