@@ -21,6 +21,7 @@ import (
2121 "testing"
2222
2323 "github.com/google/go-cmp/cmp"
24+ "github.com/google/go-cmp/cmp/cmpopts"
2425 "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/constants"
2526)
2627
@@ -283,11 +284,11 @@ func TestExtractAndDefaultParameters(t *testing.T) {
283284 },
284285 {
285286 name : "confidential compute enabled with valid KMS key" ,
286- parameters : map [string ]string {ParameterKeyEnableConfidentialCompute : "true" , ParameterKeyDiskEncryptionKmsKey : validRegionalKmsKey },
287+ parameters : map [string ]string {ParameterKeyEnableConfidentialCompute : "true" , ParameterKeyDiskEncryptionKmsKey : validKmsKeyRegional },
287288 expectParams : DiskParameters {
288289 DiskType : "pd-standard" ,
289290 ReplicationType : "none" ,
290- DiskEncryptionKMSKey : validRegionalKmsKey ,
291+ DiskEncryptionKMSKey : validKmsKeyRegional ,
291292 EnableConfidentialCompute : true ,
292293 Tags : map [string ]string {},
293294 Labels : map [string ]string {},
@@ -551,7 +552,7 @@ func TestExtractAndDefaultParameters(t *testing.T) {
551552 return
552553 }
553554
554- if diff := cmp .Diff (tc .expectParams , p ); diff != "" {
555+ if diff := cmp .Diff (tc .expectParams , p , cmpopts . IgnoreUnexported ( DiskParameters {}) ); diff != "" {
555556 t .Errorf ("ExtractAndDefaultParameters(%+v): -want, +got \n %s" , tc .parameters , diff )
556557 }
557558
0 commit comments