update capability_controller.go, make sure that annotations is generated correctly.StorageClass without csiDriver will no longer generate false annotations.
Signed-off-by: f10atin9 <f10atin9@kubesphere.io>
This commit is contained in:
@@ -270,3 +270,22 @@ func TestStorageClassHadOneAnnotation(t *testing.T) {
|
||||
// Run test
|
||||
fixture.run(getKey(storageClass, t))
|
||||
}
|
||||
|
||||
func TestStorageClassHadNoCSIDriver(t *testing.T) {
|
||||
fixture := newFixture(t, true)
|
||||
storageClass := newStorageClass("csi-example", "csi.example.com")
|
||||
storageClass.Annotations = map[string]string{}
|
||||
storageClassUpdate := storageClass.DeepCopy()
|
||||
storageClass.Annotations = map[string]string{annotationAllowSnapshot: "false"}
|
||||
storageClass.Annotations = map[string]string{annotationAllowClone: "false"}
|
||||
|
||||
// Object exist
|
||||
fixture.storageObjects = append(fixture.storageObjects, storageClass)
|
||||
fixture.storageClassLister = append(fixture.storageClassLister, storageClass)
|
||||
|
||||
// Action expected
|
||||
fixture.expectUpdateStorageClassAction(storageClassUpdate)
|
||||
|
||||
// Run test
|
||||
fixture.run(getKey(storageClass, t))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user