OCPCLOUD-3541: Use feature gates consistently - #603
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughInfrastructure type detection now returns two values, platform-specific providers and migration controllers honor feature gates, and controller startup wiring is simplified. Unsupported-platform reconciliation branches are removed, with corresponding tests and dependency updates. ChangesPlatform and feature-gated controller flow
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Main
participant getControllers
participant FeatureGates
participant Infrastructure
participant allControllers
Main->>getControllers: Select migration reconcilers
getControllers->>FeatureGates: GetFeatureGates
getControllers->>Infrastructure: GetCAPITypesForInfrastructure
getControllers->>allControllers: Build enabled reconcilers
allControllers-->>Main: Return controller map
Suggested reviewers: 🚥 Pre-merge checks | ✅ 13 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (13 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@mdbooth: This pull request references OCPCLOUD-3541 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/pipeline required |
|
Scheduling tests matching the |
|
/pipeline auto |
|
Pipeline controller notification The |
|
Scheduling tests matching the |
|
Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage. |
|
/test images |
The revision controller now checks platform-specific CAPI feature gates when building the component list. Platform-specific provider profiles are only included when the corresponding feature gate is enabled.
Remove the IsSupportedPlatform/SupportedPlatform guards from the capi-operator entrypoint. The operator is deployed by CVO only when the ClusterAPIMachineManagement feature gate is enabled, so all controllers should run whenever the operator is deployed. Platform-specific provider selection is handled independently by the revision controller.
|
Scheduling tests matching the |
pmeida
left a comment
There was a problem hiding this comment.
Clean refactor.
Just minor nits.
|
|
||
| // IsMAPIMigrationEnabledForPlatform returns true if MAPI migration is enabled for the given | ||
| // platform in the given feature gates. | ||
| func IsMAPIMigrationEnabledForPlatform(platform configv1.PlatformType, featureGates featuregates.FeatureGate) bool { |
There was a problem hiding this comment.
nit:
IsCAPIEnabledForPlatform takes (featureGates, platform), but the new IsMAPIMigrationEnabledForPlatform takes (platform, featureGates). We can make the order consistent.
There was a problem hiding this comment.
Just about worth a respin, I think.
| func(m *mapiv1beta1.MachineSetStatus, c randfill.Continue) { | ||
| c.FillNoCustom(m) | ||
|
|
||
| m.LabelSelector = "" // Ignore, this field. Both MAPI and CAPI (field is called 'selector') set this from spec.selector. |
There was a problem hiding this comment.
nit:
The comma here creates an awkward read
There was a problem hiding this comment.
I can't believe a clanker would have written that, but I can't believe I would have written that either 😅 Gonna blame a clanker.
|
Scheduling tests matching the |
|
/lgtm |
|
@mdbooth: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
This change removes various hard-coded assumptions in the code about which
platforms are supported and uses feature gates exclusively for feature
enablement. Specifically:
regardless of whether the platform has support.
enabled.
enabling any platform-specific profiles.
featuregate and the per-platform MachineAPIMigration instead of hard-coding
AWS and OpenStack.
Summary by CodeRabbit
New Features
Bug Fixes
Refactor