@@ -107,7 +107,7 @@ func TestExtractAndDefaultParameters(t *testing.T) {
107
107
ReplicationType : "none" ,
108
108
DiskEncryptionKMSKey : "" ,
109
109
Tags : map [string ]string {tagKeyCreatedForClaimName : "testPVCName" , tagKeyCreatedForClaimNamespace : "testPVCNamespace" , tagKeyCreatedForVolumeName : "testPVName" , tagKeyCreatedBy : "testDriver" },
110
- Labels : map [string ]string {},
110
+ Labels : map [string ]string {labelKeyCreatedForClaimName : "testPVCName" , labelKeyCreatedForClaimNamespace : "testPVCNamespace" , labelKeyCreatedForVolumeName : "testPVName" },
111
111
},
112
112
},
113
113
{
@@ -146,18 +146,30 @@ func TestExtractAndDefaultParameters(t *testing.T) {
146
146
Labels : map [string ]string {"key1" : "value1" , "label-1" : "value-a" , "label-2" : "label-value-2" },
147
147
},
148
148
},
149
- {
150
- name : "PVC labels" ,
151
- parameters : map [string ]string {ParameterKeyPVCName : "testPVCName" , ParameterKeyPVCNamespace : "testPVCNamespace" , ParameterKeyPVName : "testPVName" },
152
- labels : map [string ]string {},
153
- expectParams : DiskParameters {
154
- DiskType : "pd-standard" ,
155
- ReplicationType : "none" ,
156
- DiskEncryptionKMSKey : "" ,
157
- Tags : map [string ]string {},
158
- Labels : map [string ]string {labelKeyCreatedForClaimName : "testPVCName" , labelKeyCreatedForClaimNamespace : "testPVCNamespace" , labelKeyCreatedForVolumeName : "testPVName" },
159
- },
160
- },
149
+ {
150
+ name : "PVC labels" ,
151
+ parameters : map [string ]string {ParameterKeyPVCName : "testPVCName" , ParameterKeyPVCNamespace : "testPVCNamespace" , ParameterKeyPVName : "testPVName" },
152
+ labels : map [string ]string {},
153
+ expectParams : DiskParameters {
154
+ DiskType : "pd-standard" ,
155
+ ReplicationType : "none" ,
156
+ DiskEncryptionKMSKey : "" ,
157
+ Tags : map [string ]string {tagKeyCreatedForClaimName : "testPVCName" , tagKeyCreatedForClaimNamespace : "testPVCNamespace" , tagKeyCreatedForVolumeName : "testPVName" , tagKeyCreatedBy : "testDriver" },
158
+ Labels : map [string ]string {labelKeyCreatedForClaimName : "testPVCName" , labelKeyCreatedForClaimNamespace : "testPVCNamespace" , labelKeyCreatedForVolumeName : "testPVName" },
159
+ },
160
+ },
161
+ {
162
+ name : "PVC labels-override" ,
163
+ parameters : map [string ]string {ParameterKeyPVCName : "testPVCName" , ParameterKeyPVCNamespace : "testPVCNamespace" , ParameterKeyPVName : "testPVName" },
164
+ labels : map [string ]string {labelKeyCreatedForClaimNamespace : "test-override" },
165
+ expectParams : DiskParameters {
166
+ DiskType : "pd-standard" ,
167
+ ReplicationType : "none" ,
168
+ DiskEncryptionKMSKey : "" ,
169
+ Tags : map [string ]string {tagKeyCreatedForClaimName : "testPVCName" , tagKeyCreatedForClaimNamespace : "testPVCNamespace" , tagKeyCreatedForVolumeName : "testPVName" , tagKeyCreatedBy : "testDriver" },
170
+ Labels : map [string ]string {labelKeyCreatedForClaimName : "testPVCName" , labelKeyCreatedForClaimNamespace : "testPVCNamespace" , labelKeyCreatedForVolumeName : "testPVName" },
171
+ },
172
+ },
161
173
}
162
174
163
175
for _ , tc := range tests {
0 commit comments