Improve test coverage: pkg/api/persistentvolume

This commit is contained in:
Mengjiao Liu 2021-12-21 17:33:02 +08:00
parent 7046fc258d
commit 7319114cdd

View File

@ -76,6 +76,13 @@ func TestDropDisabledFields(t *testing.T) {
oldSpec: specWithCSISecrets(nil),
expectOldSpec: specWithCSISecrets(nil),
},
"disabled csi expansion clears secrets when old pv did not had secrets": {
csiExpansionEnabled: false,
newSpec: specWithCSISecrets(secretRef),
expectNewSpec: specWithCSISecrets(nil),
oldSpec: specWithCSISecrets(nil),
expectOldSpec: specWithCSISecrets(nil),
},
}
for name, tc := range tests {