Skip to content

Added fixes for test key handling. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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