Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dsc creation postpone #1041

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,21 @@ func main() { //nolint:funlen
}
}

// Create default DSC CR for managed RHODS
if platform == cluster.ManagedRhods {
var createDefaultDSCFunc manager.RunnableFunc = func(ctx context.Context) error {
err := upgrade.CreateDefaultDSC(context.TODO(), setupClient)
if err != nil {
setupLog.Error(err, "unable to create default DSC CR by the operator")
}
return err
}
err := mgr.Add(createDefaultDSCFunc)
if err != nil {
setupLog.Error(err, "error scheduling DSC creation")
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 {
Expand All @@ -222,13 +237,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")
Expand Down
2 changes: 1 addition & 1 deletion pkg/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func CreateDefaultDSC(ctx context.Context, cli client.Client) error {
},
},
}
err := cli.Create(ctx, releaseDataScienceCluster)
err := cluster.CreateWithRetry(ctx, cli, releaseDataScienceCluster, 1) // 1 min timeout
switch {
case err == nil:
fmt.Printf("created DataScienceCluster resource\n")
Expand Down
Loading