Skip to content

Commit 0cf8c11

Browse files
(fix) Helm to Boxcutter migration during OLM upgrade
When upgrading OLM from standard (Helm runtime) to experimental (Boxcutter runtime), the BoxcutterStorageMigrator creates a ClusterExtensionRevision from the existing Helm release. However, the migrated revision was created without status conditions, causing a race condition where it wasn't recognized as "Installed". This fix sets an initial Succeeded status on migrated revisions, ensuring they're immediately recognized and allowing version upgrades to proceed correctly after OLM upgrades. Fixes test-upgrade-st2ex-e2e failures.
1 parent c677d48 commit 0cf8c11

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

internal/operator-controller/applier/boxcutter.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,20 @@ func (m *BoxcutterStorageMigrator) Migrate(ctx context.Context, ext *ocv1.Cluste
266266
return fmt.Errorf("getting created revision: %w", err)
267267
}
268268

269+
// Set initial status on the migrated revision to mark it as succeeded.
270+
// This ensures the revision is immediately recognized as "Installed" rather than "RollingOut"
271+
// when BoxcutterRevisionStatesGetter retrieves revision states.
272+
meta.SetStatusCondition(&rev.Status.Conditions, metav1.Condition{
273+
Type: ocv1.ClusterExtensionRevisionTypeSucceeded,
274+
Status: metav1.ConditionTrue,
275+
Reason: "Migrated",
276+
Message: "Migrated from Helm release",
277+
ObservedGeneration: rev.GetGeneration(),
278+
})
279+
if err := m.Client.Status().Update(ctx, rev); err != nil {
280+
return fmt.Errorf("updating migrated revision status: %w", err)
281+
}
282+
269283
return nil
270284
}
271285

0 commit comments

Comments
 (0)