Skip to content

Commit

Permalink
Fix setting default StorageClass
Browse files Browse the repository at this point in the history
  • Loading branch information
presztak committed Sep 23, 2023
1 parent bd86e95 commit 49b28ff
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/addons/addons_storage_classes.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ func enableOrDisableStorageClasses(cc *config.ClusterConfig, name string, val st
}

if enable {
// Enable addon before marking it as default
if err = EnableOrDisableAddon(cc, name, val); err != nil {
return err
}
// Only StorageClass for 'name' should be marked as default
err = storageclass.SetDefaultStorageClass(storagev1, class)
if err != nil {
Expand All @@ -75,7 +79,10 @@ func enableOrDisableStorageClasses(cc *config.ClusterConfig, name string, val st
if err != nil {
return errors.Wrapf(err, "Error disabling %s as the default storage class", class)
}
if err = EnableOrDisableAddon(cc, name, val); err != nil {
return err
}
}

return EnableOrDisableAddon(cc, name, val)
return nil
}

0 comments on commit 49b28ff

Please sign in to comment.