Skip to content

Commit 2c9984f

Browse files
luohaomattcary
authored andcommitted
fixup: append snapshotclass name to driver name
1 parent 084aefe commit 2c9984f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

test/k8s-integration/config/test-config-template.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Timeouts:
1010
{{ end }}
1111
{{end}}
1212
DriverInfo:
13-
Name: csi-gcepd-{{.StorageClass}}
13+
Name: csi-gcepd-{{.StorageClass}}--{{.SnapshotClass}}
1414
SupportedFsType:
1515
{{range .SupportedFsType}} {{ . }}:
1616
{{end}}
@@ -28,4 +28,4 @@ DriverInfo:
2828
Max: 64Ti
2929
TopologyKeys:
3030
- topology.gke.io/zone
31-
NumAllowedTopologies: {{.NumAllowedTopologies}}
31+
NumAllowedTopologies: {{.NumAllowedTopologies}}

test/k8s-integration/driver-config.go

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ type driverConfig struct {
1313
StorageClassFile string
1414
StorageClass string
1515
SnapshotClassFile string
16+
SnapshotClass string
1617
Capabilities []string
1718
SupportedFsType []string
1819
MinimumVolumeSize string
@@ -115,11 +116,15 @@ func generateDriverConfigFile(testParams *testParameters, storageClassFile strin
115116
}
116117

117118
var absSnapshotClassFilePath string
119+
var snapshotClassName string
118120
// If snapshot class is passed in as argument, include snapshot specific driver capabiltiites.
119121
if testParams.snapshotClassFile != "" {
120122
caps = append(caps, "snapshotDataSource")
121123
// Update the absolute file path pointing to the snapshot class file, if it is provided as an argument.
122124
absSnapshotClassFilePath = filepath.Join(testParams.pkgDir, testConfigDir, testParams.snapshotClassFile)
125+
snapshotClassName = testParams.snapshotClassFile[:strings.LastIndex(testParams.snapshotClassFile, ".")]
126+
} else {
127+
snapshotClassName = "no-volumesnapshotclass"
123128
}
124129

125130
caps = append(caps, "pvcDataSource")
@@ -136,6 +141,7 @@ func generateDriverConfigFile(testParams *testParameters, storageClassFile strin
136141
StorageClassFile: filepath.Join(testParams.pkgDir, testConfigDir, storageClassFile),
137142
StorageClass: storageClassFile[:strings.LastIndex(storageClassFile, ".")],
138143
SnapshotClassFile: absSnapshotClassFilePath,
144+
SnapshotClass: snapshotClassName,
139145
SupportedFsType: fsTypes,
140146
Capabilities: caps,
141147
MinimumVolumeSize: minimumVolumeSize,

0 commit comments

Comments
 (0)