ci: delete svg in helm test

The filesystem is not being deleted because of the existing svg.
Add a cliet call to delete the deafult csi svg,
for helm test

Signed-off-by: parth-gr <partharora1010@gmail.com>
This commit is contained in:
parth-gr committed 2023-12-12 00:52:19 +05:30
1 parent 41404c131c
commit 60e879050a
1 file changed
+8 -1
+8 -1
View File
@@ -135,8 +135,15 @@ func (f *FilesystemOperation) ScaleDown(name, namespace string) error {
func (f *FilesystemOperation) Delete(name, namespace string) error {
ctx := context.TODO()
options := &metav1.DeleteOptions{}
logger.Infof("Deleting subvolumegroup %s in namespace %s dependent of ceph filesystem %s", name+"-csi", namespace, name)
err := f.k8sh.RookClientset.CephV1().CephFilesystemSubVolumeGroups(namespace).Delete(ctx, name+"-csi", *options)
if err != nil && !kerrors.IsNotFound(err) {
return err
}
logger.Infof("Deleting filesystem %s in namespace %s", name, namespace)
err := f.k8sh.RookClientset.CephV1().CephFilesystems(namespace).Delete(ctx, name, *options)
err = f.k8sh.RookClientset.CephV1().CephFilesystems(namespace).Delete(ctx, name, *options)
if err != nil && !kerrors.IsNotFound(err) {
return err
}