You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix duplicate ClusterExtensionRevisions during Helm-to-Boxcutter migration
This commit fixes OCPBUGS-62943 where two ClusterExtensionRevisions were
being created during Helm-to-Boxcutter migration instead of just one.
Root causes:
1. Manifest ordering inconsistency: CRDs from Helm release manifest and
bundle manifest appeared in different orders, causing PhaseSort to
produce different phase structures even though they contained the same
objects.
2. CollisionProtection mismatch: The migrated revision had
collisionProtection=None (needed to adopt Helm-managed resources) while
the bundle-generated revision had collisionProtection=Prevent (the
default value).
Solution:
1. Added deterministic sorting in PhaseSort (phase.go):
- Sort objects within each phase by Group, Version, Kind, Namespace, Name
- Ensures consistent phase structure regardless of input order
- Critical for comparing revisions from different sources
2. Added CollisionProtection preservation (boxcutter.go):
- New preserveCollisionProtection() function copies CollisionProtection
values from current revision to desired revision for matching objects
- New objectKey() helper generates unique keys based on GVK+namespace+name
- Called before patching to ensure CollisionProtection values match
With these changes, only a single ClusterExtensionRevision is created
during Helm-to-Boxcutter migration, as expected.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Todd Short <tshort@redhat.com>
0 commit comments