Repository: kubernetes-sigs/gcp-compute-persistent-disk-csi-driver
Pull request #1911 (2025-01-22 04:37:42)

Update kubetest2 version
<!--  Thanks for sending a pull request!  Here are some tips for you:

1. If this is your first time, please read our contributor guidelines: https://git.k8s.io/community/contributors/guide#your-first-contribution and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide
2. Follow the instructions for writing a release note: https://git.k8s.io/community/contributors/guide/release-notes.md
3. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests
-->

**What type of PR is this?**
> Uncomment only one ` /kind <>` line, hit enter to put that in a new line, and remove leading whitespaces from that line:
>
> /kind api-change
> /kind bug
/kind cleanup
> /kind design
> /kind documentation
> /kind failing-test
> /kind feature
> /kind flake

**What this PR does / why we need it**: Update `kubetest2` to a newer version for CI testgrid. This bumps kt2 to a version from December 16, 2024: https://github.com/kubernetes-sigs/kubetest2/commit/22d5b1410bef09ae679fa5813a5f0d196b6079de

**Which issue(s) this PR fixes**:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->
Fixes #

**Special notes for your reviewer**:

**Does this PR introduce a user-facing change?**:
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
NONE
```



Patch:
diff --git a/CHANGELOG/CHANGELOG-1.15.md b/CHANGELOG/CHANGELOG-1.15.md
index 087b286d..c612677e 100644
--- a/CHANGELOG/CHANGELOG-1.15.md
+++ b/CHANGELOG/CHANGELOG-1.15.md
@@ -1,11 +1,3 @@
-# v1.15.4 - Changelog since v1.15.3
-- [release-1.15] [metrics] Fix panic during metrics manager startup by @k8s-infra-cherrypick-robot in https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/pull/1898
-
-# v1.15.3 - Changelog since v1.15.2
-* [release-1.15] Don't overwrite libc in distroless debian base image by @k8s-infra-cherrypick-robot in https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/pull/1884
-* [release-1.15] Refactor metric defer() statements to gRPC metric interceptor by @k8s-infra-cherrypick-robot in https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/pull/1886
-* Automated cherry pick of #1875: Require VACs to use SI units by @travisyx in https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/pull/1892
-
 # v1.15.2 - Changelog since v1.15.1
 
 - [release-1.15] Map RESOURCE_OPERATION_RATE_EXCEEDED to ResourceExhausted by @k8s-infra-cherrypick-robot in #1848
diff --git a/Dockerfile b/Dockerfile
index 47f6313d..d439ed96 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -84,6 +84,7 @@ COPY --from=debian /lib/${LIB_DIR_PREFIX}-linux-gnu/libselinux.so.1 \
                    /lib/${LIB_DIR_PREFIX}-linux-gnu/liblzma.so.5 \
                    /lib/${LIB_DIR_PREFIX}-linux-gnu/libreadline.so.8 \
                    /lib/${LIB_DIR_PREFIX}-linux-gnu/libz.so.1 \
+                   /lib/${LIB_DIR_PREFIX}-linux-gnu/libc.so.6 \
                    /lib/${LIB_DIR_PREFIX}-linux-gnu/liburcu.so.8 \ 
                    /lib/${LIB_DIR_PREFIX}-linux-gnu/libcap.so.2 \
                    /lib/${LIB_DIR_PREFIX}-linux-gnu/libcrypto.so.3 \
diff --git a/deploy/kubernetes/images/prow-stable-sidecar-rc-master/image.yaml b/deploy/kubernetes/images/prow-stable-sidecar-rc-master/image.yaml
index b5abe108..55c27b51 100644
--- a/deploy/kubernetes/images/prow-stable-sidecar-rc-master/image.yaml
+++ b/deploy/kubernetes/images/prow-stable-sidecar-rc-master/image.yaml
@@ -48,6 +48,6 @@ metadata:
 imageTag:
   name: registry.k8s.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver
   newName: gcr.io/k8s-staging-cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver
-  newTag: "v1.15.4-rc1"
+  newTag: "v1.15.2-rc3"
 ---
 
diff --git a/examples/kubernetes/demo-vol-create.yaml b/examples/kubernetes/demo-vol-create.yaml
index 5fa53604..1ca0e055 100644
--- a/examples/kubernetes/demo-vol-create.yaml
+++ b/examples/kubernetes/demo-vol-create.yaml
@@ -16,7 +16,7 @@ metadata:
 driverName: pd.csi.storage.gke.io
 parameters:
   iops: "3000"
-  throughput: "150Mi"
+  throughput: "150"
 ---
 apiVersion: storage.k8s.io/v1beta1
 kind: VolumeAttributesClass
@@ -25,7 +25,7 @@ metadata:
 driverName: pd.csi.storage.gke.io
 parameters:
   iops: "3013"
-  throughput: "151Mi"
+  throughput: "151"
 ---
 apiVersion: v1
 kind: PersistentVolumeClaim
diff --git a/pkg/common/parameters.go b/pkg/common/parameters.go
index f76c0aaa..e80346ed 100644
--- a/pkg/common/parameters.go
+++ b/pkg/common/parameters.go
@@ -201,9 +201,6 @@ func (pp *ParameterProcessor) ExtractAndDefaultParameters(parameters map[string]
 			if err != nil {
 				return p, fmt.Errorf("parameters contain invalid provisionedThroughputOnCreate parameter: %w", err)
 			}
-			if paramProvisionedThroughputOnCreate < 0 {
-				return p, fmt.Errorf("parameter provisionedThroughputOnCreate cannot be negative")
-			}
 			p.ProvisionedThroughputOnCreate = paramProvisionedThroughputOnCreate
 		case ParameterAvailabilityClass:
 			paramAvailabilityClass, err := ConvertStringToAvailabilityClass(v)
@@ -346,7 +343,7 @@ func ExtractModifyVolumeParameters(parameters map[string]string) (ModifyVolumePa
 			}
 			modifyVolumeParams.IOPS = &iops
 		case "throughput":
-			throughput, err := ConvertMiStringToInt64(value)
+			throughput, err := ConvertStringToInt64(value)
 			if err != nil {
 				return ModifyVolumeParameters{}, fmt.Errorf("parameters contain invalid throughput parameter: %w", err)
 			}
diff --git a/pkg/deviceutils/device-utils.go b/pkg/deviceutils/device-utils.go
index 24a6e8c9..75ecabbc 100644
--- a/pkg/deviceutils/device-utils.go
+++ b/pkg/deviceutils/device-utils.go
@@ -194,7 +194,7 @@ func ensureUdevToolExists(toolPath string) error {
 	if !exists {
 		// The driver should be containerized with the tool so maybe something is
 		// wrong with the build process
-		return fmt.Errorf("could not find tool at %q, unable to verify device paths", toolPath)
+		return fmt.Errorf("could not find tool at %q, unable to verify device paths", nvmeIdPath)
 	}
 	return nil
 }
diff --git a/pkg/metrics/metrics.go b/pkg/metrics/metrics.go
index 600a1b2f..52955fcb 100644
--- a/pkg/metrics/metrics.go
+++ b/pkg/metrics/metrics.go
@@ -39,6 +39,11 @@ const (
 )
 
 var (
+	gkeComponentVersion        *metrics.GaugeVec
+	pdcsiOperationErrorsMetric *metrics.CounterVec
+)
+
+func initMetrics() {
 	// This metric is exposed only from the controller driver component when GKE_PDCSI_VERSION env variable is set.
 	gkeComponentVersion = metrics.NewGaugeVec(&metrics.GaugeOpts{
 		Name: "component_version",
@@ -53,7 +58,7 @@ var (
 			StabilityLevel: metrics.ALPHA,
 		},
 		[]string{"driver_name", "method_name", "grpc_status_code", "disk_type", "enable_confidential_storage", "enable_storage_pools"})
-)
+}
 
 type MetricsManager struct {
 	registry metrics.KubeRegistry


Test patch:
diff --git a/pkg/common/parameters_test.go b/pkg/common/parameters_test.go
index 83a82353..cb60ecff 100644
--- a/pkg/common/parameters_test.go
+++ b/pkg/common/parameters_test.go
@@ -344,13 +344,6 @@ func TestExtractAndDefaultParameters(t *testing.T) {
 			labels:             map[string]string{},
 			expectErr:          true,
 		},
-		{
-			name:               "invalid storage pool parameters, negative ProvisionedThroughputOnCreate",
-			enableStoragePools: true,
-			parameters:         map[string]string{ParameterKeyType: "hyperdisk-throughput", ParameterKeyReplicationType: "none", ParameterKeyDiskEncryptionKmsKey: "foo/key", ParameterKeyLabels: "key1=value1,key2=value2", ParameterKeyResourceTags: "parent1/key1/value1,parent2/key2/value2", ParameterKeyProvisionedThroughputOnCreate: "-50Mi"},
-			labels:             map[string]string{},
-			expectErr:          true,
-		},
 		{
 			name:               "storage pool parameters, enableStoragePools is false",
 			enableStoragePools: false,
@@ -492,7 +485,7 @@ func TestSnapshotParameters(t *testing.T) {
 func TestExtractModifyVolumeParameters(t *testing.T) {
 	parameters := map[string]string{
 		"iops":       "1000",
-		"throughput": "500Mi",
+		"throughput": "500",
 	}
 
 	iops := int64(1000)
diff --git a/pkg/gce-pd-csi-driver/controller_test.go b/pkg/gce-pd-csi-driver/controller_test.go
index 06db7222..0e79a366 100644
--- a/pkg/gce-pd-csi-driver/controller_test.go
+++ b/pkg/gce-pd-csi-driver/controller_test.go
@@ -1789,7 +1789,7 @@ func TestCreateVolumeWithVolumeAttributeClassParameters(t *testing.T) {
 						},
 					},
 				},
-				MutableParameters: map[string]string{"iops": "20000", "throughput": "600Mi"},
+				MutableParameters: map[string]string{"iops": "20000", "throughput": "600"},
 			},
 			expIops:       20000,
 			expThroughput: 600,
@@ -1822,7 +1822,7 @@ func TestCreateVolumeWithVolumeAttributeClassParameters(t *testing.T) {
 						},
 					},
 				},
-				MutableParameters: map[string]string{"iops": "20000", "throughput": "600Mi"},
+				MutableParameters: map[string]string{"iops": "20000", "throughput": "600"},
 			},
 			expIops:       0,
 			expThroughput: 0,
@@ -1890,7 +1890,7 @@ func TestVolumeModifyOperation(t *testing.T) {
 			name: "Update volume with valid parameters",
 			req: &csi.ControllerModifyVolumeRequest{
 				VolumeId:          testVolumeID,
-				MutableParameters: map[string]string{"iops": "20000", "throughput": "600Mi"},
+				MutableParameters: map[string]string{"iops": "20000", "throughput": "600"},
 			},
 			diskType: "hyperdisk-balanced",
 			params: &common.DiskParameters{
@@ -1906,7 +1906,7 @@ func TestVolumeModifyOperation(t *testing.T) {
 			name: "Update volume with invalid parameters",
 			req: &csi.ControllerModifyVolumeRequest{
 				VolumeId:          testVolumeID,
-				MutableParameters: map[string]string{"iops": "0", "throughput": "0Mi"},
+				MutableParameters: map[string]string{"iops": "0", "throughput": "0"},
 			},
 			diskType: "hyperdisk-balanced",
 			params: &common.DiskParameters{
@@ -1922,7 +1922,7 @@ func TestVolumeModifyOperation(t *testing.T) {
 			name: "Update volume with valid parameters but invalid disk type",
 			req: &csi.ControllerModifyVolumeRequest{
 				VolumeId:          testVolumeID,
-				MutableParameters: map[string]string{"iops": "20000", "throughput": "600Mi"},
+				MutableParameters: map[string]string{"iops": "20000", "throughput": "600"},
 			},
 			diskType: "pd-ssd",
 			params: &common.DiskParameters{
@@ -2053,7 +2053,7 @@ func TestVolumeModifyErrorHandling(t *testing.T) {
 				},
 			},
 			modifyReq: &csi.ControllerModifyVolumeRequest{
-				MutableParameters: map[string]string{"iops": "3001", "throughput": "151Mi"},
+				MutableParameters: map[string]string{"iops": "3001", "throughput": "151"},
 			},
 			modifyVolumeErrors: map[*meta.Key]error{
 				meta.ZonalKey(name, "us-central1-a"): &googleapi.Error{
@@ -2089,7 +2089,7 @@ func TestVolumeModifyErrorHandling(t *testing.T) {
 				},
 			},
 			modifyReq: &csi.ControllerModifyVolumeRequest{
-				MutableParameters: map[string]string{"iops": "10000", "throughput": "2400Mi"},
+				MutableParameters: map[string]string{"iops": "10000", "throughput": "2400"},
 			},
 			modifyVolumeErrors: map[*meta.Key]error{
 				meta.ZonalKey(name, "us-central1-a"): &googleapi.Error{Code: int(codes.InvalidArgument), Message: "InvalidArgument"},
diff --git a/pkg/metrics/metrics_test_util.go b/pkg/metrics/metrics_test_util.go
index ce0d13d9..c7714241 100644
--- a/pkg/metrics/metrics_test_util.go
+++ b/pkg/metrics/metrics_test_util.go
@@ -19,6 +19,5 @@ package metrics
 // Test-only method used for resetting metric counts.
 func (mm *MetricsManager) ResetMetrics() {
 	// Re-initialize metrics
-	gkeComponentVersion.Reset()
-	pdcsiOperationErrorsMetric.Reset()
+	initMetrics()
 }
diff --git a/test/e2e/tests/single_zone_e2e_test.go b/test/e2e/tests/single_zone_e2e_test.go
index c77c7b91..cd60d8b7 100644
--- a/test/e2e/tests/single_zone_e2e_test.go
+++ b/test/e2e/tests/single_zone_e2e_test.go
@@ -1622,7 +1622,7 @@ var _ = Describe("GCE PD CSI Driver", func() {
 			stringPtr(provisionedIOPSOnCreateHdb),
 			stringPtr(provisionedThroughputOnCreateHdb),
 			stringPtr("3013"),
-			stringPtr("181Mi"),
+			stringPtr("181"),
 		),
 		Entry(
 			"for hyperdisk-extreme",
@@ -1640,7 +1640,7 @@ var _ = Describe("GCE PD CSI Driver", func() {
 			nil,
 			stringPtr(provisionedThroughputOnCreate),
 			nil,
-			stringPtr("70Mi"),
+			stringPtr("70"),
 		),
 	)
 })
diff --git a/test/k8s-integration/config/hdb-volumeattributesclass.yaml b/test/k8s-integration/config/hdb-volumeattributesclass.yaml
index 73d5ff4f..f032912d 100644
--- a/test/k8s-integration/config/hdb-volumeattributesclass.yaml
+++ b/test/k8s-integration/config/hdb-volumeattributesclass.yaml
@@ -5,4 +5,4 @@ metadata:
 driverName: pd.csi.storage.gke.io
 parameters:
   iops: "3600"
-  throughput: "290Mi"
\ No newline at end of file
+  throughput: "290"
\ No newline at end of file
diff --git a/test/k8s-integration/filter-junit.go b/test/k8s-integration/filter-junit.go
index 88e9e4cd..02b2a30f 100644
--- a/test/k8s-integration/filter-junit.go
+++ b/test/k8s-integration/filter-junit.go
@@ -32,8 +32,12 @@ import (
  * represent all fields that we want to be passed through. It's therefore
  * not a complete solution, but good enough for Ginkgo + Spyglass.
  */
+
+type TestSuites struct {
+	XMLName   string      `xml:"testsuites"`
+	TestSuite []TestSuite `xml:"testsuite"`
+}
 type TestSuite struct {
-	XMLName   string     `xml:"testsuite"`
 	TestCases []TestCase `xml:"testcase"`
 }
 
diff --git a/test/k8s-integration/main.go b/test/k8s-integration/main.go
index 811f23ad..092526a8 100644
--- a/test/k8s-integration/main.go
+++ b/test/k8s-integration/main.go
@@ -635,9 +635,6 @@ func handle() error {
 
 func generateGCETestSkip(testParams *testParameters) string {
 	skipString := "\\[Disruptive\\]|\\[Serial\\]"
-	// Skip mount options test until we fix the invalid mount options for xfs.
-	skipString = skipString + "|csi-gcepd-sc-xfs.*provisioning.should.provision.storage.with.mount.options"
-
 	v := apimachineryversion.MustParseSemantic(testParams.clusterVersion)
 
 	// "volumeMode should not mount / map unused volumes in a pod" tests a
@@ -688,8 +685,8 @@ func generateGKETestSkip(testParams *testParameters) string {
 		skipString = skipString + "|should.provision.correct.filesystem.size.when.restoring.snapshot.to.larger.size.pvc"
 	}
 
-	// VolumeAttributesClasses were promoted to beta in 1.31, but is not supported on managed driver.
-	if curVer.lessThan(mustParseVersion("1.31.0")) || testParams.useGKEManagedDriver {
+	// VolumeAttributesClasses were promoted to beta in 1.31
+	if curVer.lessThan(mustParseVersion("1.31.0")) {
 		skipString = skipString + "|VolumeAttributesClass"
 	}
 
@@ -814,9 +811,13 @@ func runTestsWithConfig(testParams *testParameters, testConfigArg, reportPrefix
 		focuses = append(focuses, "VolumeSnapshotDataSource")
 	}
 
-	// testParams.volumeAttributesClassFile is always set, so rely on test skip to determine if VAC tests should
-	// be run.
-	if testParams.volumeAttributesClassFile != "" && !strings.Contains(skip, "VolumeAttributesClass") {
+	// If testParams.volumeAttributesClassFile is empty, then VAC tests will be automatically skipped. Otherwise confirm
+	// the right tests are run.
+	if testParams.volumeAttributesClassFile != "" && strings.Contains(skip, "VolumeAttributesClass") {
+		return fmt.Errorf("VolumeAttributesClass file %s specified, but VolumeAttributesClass tests are skipped: %s", testParams.volumeAttributesClassFile, skip)
+	}
+	if testParams.volumeAttributesClassFile != "" {
+		// If there is a VolumeAttributesClass file, run VAC tests
 		focuses = append(focuses, "VolumeAttributesClass")
 	}
 
diff --git a/test/run-k8s-integration-ci.sh b/test/run-k8s-integration-ci.sh
index 67a75c04..99db4588 100755
--- a/test/run-k8s-integration-ci.sh
+++ b/test/run-k8s-integration-ci.sh
@@ -64,7 +64,7 @@ export GCE_PD_VERBOSITY=9
 make -C "${PKGDIR}" test-k8s-integration
 
 if [ "$use_kubetest2" = true ]; then
-    kt2_version=0e09086b60c122e1084edd2368d3d27fe36f384f
+    kt2_version=22d5b1410bef09ae679fa5813a5f0d196b6079de
     go install sigs.k8s.io/kubetest2@${kt2_version}
     go install sigs.k8s.io/kubetest2/kubetest2-gce@${kt2_version}
     go install sigs.k8s.io/kubetest2/kubetest2-gke@${kt2_version}
diff --git a/test/run-k8s-integration-migration.sh b/test/run-k8s-integration-migration.sh
index 343a7e8c..3abf3dab 100755
--- a/test/run-k8s-integration-migration.sh
+++ b/test/run-k8s-integration-migration.sh
@@ -24,7 +24,7 @@ readonly use_kubetest2=${USE_KUBETEST2:-false}
 make -C "${PKGDIR}" test-k8s-integration
 
 if [ "$use_kubetest2" = true ]; then
-    kt2_version=0e09086b60c122e1084edd2368d3d27fe36f384f
+    kt2_version=22d5b1410bef09ae679fa5813a5f0d196b6079de
     go install sigs.k8s.io/kubetest2@${kt2_version}
     go install sigs.k8s.io/kubetest2/kubetest2-gce@${kt2_version}
     go install sigs.k8s.io/kubetest2/kubetest2-gke@${kt2_version}
diff --git a/test/run-k8s-integration.sh b/test/run-k8s-integration.sh
index 158d1e48..adab0f31 100755
--- a/test/run-k8s-integration.sh
+++ b/test/run-k8s-integration.sh
@@ -28,7 +28,6 @@ readonly teardown_driver=${GCE_PD_TEARDOWN_DRIVER:-true}
 readonly gke_node_version=${GKE_NODE_VERSION:-}
 readonly use_kubetest2=${USE_KUBETEST2:-true}
 readonly migration_test=${MIGRATION_TEST:-false}
-readonly volumeattributesclass_files=${VOLUME_ATTRIBUTES_CLASS_FILES:-hdb-volumeattributesclass.yaml}
 
 export GCE_PD_VERBOSITY=9
 
@@ -37,7 +36,7 @@ readonly GCE_PD_TEST_FOCUS="PersistentVolumes\sGCEPD|[V|v]olume\sexpand|\[sig-st
 make -C "${PKGDIR}" test-k8s-integration
 
 if [ "$use_kubetest2" = true ]; then
-    kt2_version=0e09086b60c122e1084edd2368d3d27fe36f384f
+    kt2_version=22d5b1410bef09ae679fa5813a5f0d196b6079de
     go install sigs.k8s.io/kubetest2@${kt2_version}
     go install sigs.k8s.io/kubetest2/kubetest2-gce@${kt2_version}
     go install sigs.k8s.io/kubetest2/kubetest2-gke@${kt2_version}
@@ -49,15 +48,12 @@ base_cmd="${PKGDIR}/bin/k8s-integration-test \
             --do-driver-build=${do_driver_build} --teardown-driver=${teardown_driver} \
             --do-k8s-build=${do_k8s_build} --boskos-resource-type=${boskos_resource_type} \
             --storageclass-files=sc-balanced.yaml --snapshotclass-files=pd-volumesnapshotclass.yaml \
+            --volumeattributesclass-files=hdb-volumeattributesclass.yaml \
             --storageclass-for-vac-file=sc-hdb.yaml \
             --kube-runtime-config=api/all=true \
             --deployment-strategy=${deployment_strategy} --test-version=${test_version} \
             --num-nodes=3 --image-type=${image_type} --use-kubetest2=${use_kubetest2}"
 
-if [[ -n "${volumeattributesclass_files}" ]]; then
-  base_cmd+=" --volumeattributesclass-files=${volumeattributesclass_files}"
-fi
-
 if [ "$use_gke_managed_driver" = false ]; then
   base_cmd="${base_cmd} --deploy-overlay-name=${overlay_name}"
 else