Skip to content

Commit

Permalink
Added fixes for test key handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjswerdlow committed Jan 10, 2025
1 parent 5789a07 commit c85f509
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion pkg/common/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import (
)

const (
// Disk Params
ParameterAccessMode = "access-mode"

// Parameters for StorageClass
ParameterKeyType = "type"
ParameterKeyReplicationType = "replication-type"
Expand Down Expand Up @@ -151,7 +154,6 @@ func (pp *ParameterProcessor) ExtractAndDefaultParameters(parameters map[string]
Tags: make(map[string]string), // Default
Labels: make(map[string]string), // Default
ResourceTags: make(map[string]string), // Default
AccessMode: "READ_WRITE_SINGLE", // Default
}

for k, v := range extraVolumeLabels {
Expand Down Expand Up @@ -254,6 +256,10 @@ func (pp *ParameterProcessor) ExtractAndDefaultParameters(parameters map[string]
if paramEnableMultiZoneProvisioning {
p.Labels[MultiZoneLabel] = "true"
}
case ParameterAccessMode:
if v != "" {
p.AccessMode = v
}
default:
return p, fmt.Errorf("parameters contains invalid option %q", k)
}
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/tests/single_zone_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1708,7 +1708,8 @@ func deleteVolumeOrError(client *remote.CsiClient, volID string) {
func createAndValidateUniqueZonalMultiWriterDisk(client *remote.CsiClient, project, zone string, diskType string) (string, string) {
// Create Disk
disk := typeToDisk[diskType]
disk.params.AccessMode = "READ_WRITE_MANY"

disk.params[common.ParameterAccessMode] = "READ_WRITE_MANY"

volName := testNamePrefix + string(uuid.NewUUID())
volume, err := client.CreateVolumeWithCaps(volName, disk.params, defaultMwSizeGb,
Expand Down

0 comments on commit c85f509

Please sign in to comment.