diff --git a/main.go b/main.go index 3747357da6a..a3e1c931fb4 100644 --- a/main.go +++ b/main.go @@ -214,6 +214,14 @@ func main() { //nolint:funlen } } + // Create default DSC CR for managed RHODS + if platform == cluster.ManagedRhods { + if err := upgrade.CreateDefaultDSC(context.TODO(), setupClient); err != nil { + setupLog.Error(err, "unable to create default DSC CR by the operator") + os.Exit(1) + } + } + // Cleanup resources from previous v2 releases var cleanExistingResourceFunc manager.RunnableFunc = func(ctx context.Context) error { if err = upgrade.CleanupExistingResource(ctx, setupClient, platform, dscApplicationsNamespace, dscMonitoringNamespace); err != nil { @@ -222,13 +230,6 @@ func main() { //nolint:funlen return err } - // Create default DSC CR for managed RHODS - if platform == cluster.ManagedRhods { - if err := upgrade.CreateDefaultDSC(context.TODO(), setupClient); err != nil { - setupLog.Error(err, "unable to create default DSC CR by the operator") - os.Exit(1) - } - } err = mgr.Add(cleanExistingResourceFunc) if err != nil { setupLog.Error(err, "error remove deprecated resources from previous version")