Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Jan 28, 2025
1 parent 7d2ed8b commit 3eecef3
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions operator/pkg/cli/migratev2/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ type LogFunc func(string, ...any)
// installations to configmaps, enables the v2 admin console, and finally removes the operator
// chart.
func Run(ctx context.Context, logf LogFunc, cli client.Client, in *ecv1beta1.Installation) (err error) {
ok, err := needsMigration(ctx, cli)
if err != nil {
return fmt.Errorf("check if migration is needed: %w", err)
}
if !ok {
logf("No v2 migration needed")
return nil
}

logf("Running v2 migration")

err = setV2MigrationInProgress(ctx, logf, cli, in)
Expand All @@ -30,15 +39,6 @@ func Run(ctx context.Context, logf LogFunc, cli client.Client, in *ecv1beta1.Ins
}
}()

ok, err := needsMigration(ctx, cli)
if err != nil {
return fmt.Errorf("check if migration is needed: %w", err)
}
if !ok {
logf("No v2 migration needed")
return nil
}

// scale down the operator to ensure that it does not reconcile and revert our changes.
err = scaleDownOperator(ctx, logf, cli)
if err != nil {
Expand Down

0 comments on commit 3eecef3

Please sign in to comment.