OCPBUGS-94057: UPSTREAM: 3265: 🐛 allow unconditional providerID updates in OpenStackMachine - #425
OCPBUGS-94057: UPSTREAM: 3265: 🐛 allow unconditional providerID updates in OpenStackMachine#425simkam wants to merge 2 commits into
Conversation
…chine Remove conditional immutability check that only allowed providerID and instanceID to be set when the old value was nil. This created a race condition where controller reconciliation retries would be rejected by the webhook, causing IPI installation failures. The fix aligns CAPO with upstream CAPI patterns used by AWS, GCP, and VSphere providers, which all allow providerID to be updated unconditionally. This prevents webhook rejections during normal controller operation while maintaining the same practical behavior since the controller only sets these fields once. | Provider | File | Restriction | |----------|------|-------------| | **AWS (CAPA)** | [awsmachine_webhook.go](https://github.com/kubernetes-sigs/cluster-api-provider-aws/blob/af0e5ca481bd15349b3d6e3336238152467086a4/webhooks/awsmachine_webhook.go#L128) | Unconditional | | **GCP (CAPG)** | [gcpmachine_webhook.go](https://github.com/kubernetes-sigs/cluster-api-provider-gcp/blob/930755247ae023047b1d4b62b656c3112ecdaecc/webhooks/gcpmachine_webhook.go#L88) | Unconditional | | **VSphere (CAPV)** | [vspheremachine.go](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/blob/dadbe25b1117ace60df90d3dd9e4c943d39ac4a0/internal/webhooks/vspheremachine.go#L109) | Allowlist | | **Azure (CAPZ)** | [azuremachine_webhook.go](https://github.com/kubernetes-sigs/cluster-api-provider-azure/blob/cd72698e45a63a84a8dbf2f385837e42a5735278/internal/webhooks/azuremachine_webhook.go#L75) | No restriction |
|
@simkam: This pull request references Jira Issue OCPBUGS-94057, which is valid. 3 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira (tjadhav@redhat.com), skipping review request. The bug has been updated to refer to the pull request using the external bug tracker. 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. |
|
[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 |
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughOpenStackMachine update validation now ignores ChangesOpenStackMachine providerID validation
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/e2e/suites/apivalidations/openstackmachine_test.go (1)
63-75: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd e2e coverage for
instanceIDupdates.The webhook now exempts both
providerIDandinstanceIDfrom immutability checks, but this test only verifiesproviderID. Add an analogous set-and-update assertion forinstanceIDto prevent regressions in the second behavior.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/e2e/suites/apivalidations/openstackmachine_test.go` around lines 63 - 75, Add analogous e2e coverage for instanceID in the “should allow the providerID to be updated” test: set machine.Spec.InstanceID after creation, update successfully, then change it to a different value and verify the second update succeeds, matching the existing providerID assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@test/e2e/suites/apivalidations/openstackmachine_test.go`:
- Around line 63-75: Add analogous e2e coverage for instanceID in the “should
allow the providerID to be updated” test: set machine.Spec.InstanceID after
creation, update successfully, then change it to a different value and verify
the second update succeeds, matching the existing providerID assertions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 9824cfec-ef8b-4342-b557-1d2e363e3e03
📒 Files selected for processing (2)
pkg/webhooks/openstackmachine_webhook.gotest/e2e/suites/apivalidations/openstackmachine_test.go
|
/test e2e-hypershift |
|
@simkam: all tests passed! 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. |
|
/lgtm /approve |
cherry-picking kubernetes-sigs#3265
Remove conditional immutability check that only allowed providerID and instanceID to be set when the old value was nil. This created a race condition where controller reconciliation retries would be rejected by the webhook, causing IPI installation failures.
The fix aligns CAPO with upstream CAPI patterns used by AWS, GCP, and VSphere providers, which all allow providerID to be updated unconditionally. This prevents webhook rejections during normal controller operation while maintaining the same practical behavior since the controller only sets these fields once.
/hold
Summary by CodeRabbit
providerIDconsistently during validation.providerIDare now accepted as expected, while other protected specification changes remain restricted.providerIDcan be modified successfully.