Skip to content

🐛 Enforce rollout strategy/type consistency and warn on disabled topology MHC overrides#13368

Open
miltalex wants to merge 1 commit intokubernetes-sigs:mainfrom
miltalex:feat/validation
Open

🐛 Enforce rollout strategy/type consistency and warn on disabled topology MHC overrides#13368
miltalex wants to merge 1 commit intokubernetes-sigs:mainfrom
miltalex:feat/validation

Conversation

@miltalex
Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Adds missing rollout strategy validation parity for MachineDeployment, Cluster.spec.topology, and ClusterClass (reject rollingUpdate fields when strategy type is OnDelete), with ratcheting so unchanged pre-existing invalid values are still allowed on update. It also changes disabled topology MHC override handling to emit webhook warnings (not errors) so users can temporarily disable MHC for troubleshooting without removing config.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #8721

@k8s-ci-robot k8s-ci-robot added the do-not-merge/needs-area PR is missing an area label label Feb 22, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

This PR is currently missing an area label, which is used to identify the modified component when generating release notes.

Area labels can be added by org members by writing /area ${COMPONENT} in a comment

Please see the labels list for possible areas.

Details

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 kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 22, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @miltalex. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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 kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 22, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign justinsb for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sbueringer
Copy link
Copy Markdown
Member

It also changes disabled topology MHC override handling to emit webhook warnings (not errors) so users can temporarily disable MHC for troubleshooting without removing config.

I don't think we should allow invalid configuration just because it's convenient in cases like this

@miltalex
Copy link
Copy Markdown
Contributor Author

I don't think we should allow invalid configuration just because it's convenient in cases like this

Sharing the context from the slack conversation:

Keeping MHC fields while disabling MHC is already possible today (before this PR).

Before / current behavior:
  - spec.topology.*.healthCheck.enabled=false with checks / remediation still set:
      - Allowed
      - No warning
      - Fields are effectively ignored while disabled, but remain in the object
  - OnDelete strategy + rollingUpdate fields:
      - Allowed (no webhook validation catches the mismatch)

PR is introducing:
  - spec.topology.*.healthCheck.enabled=false with checks / remediation still set:
      - Still allowed (same as today)
      - New webhook warning is returned saying those fields are ignored while disabled
  - OnDelete strategy + rollingUpdate fields:
      - Rejected when newly introduced (or changed while invalid)
      - Unchanged pre-existing invalid values are still allowed on update (so users are not blocked following your comment)
      - Fixing an existing invalid config is allowed

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 7, 2026
…HC overrides

Signed-off-by: Miltiadis Alexis <alexmiltiadis@gmail.com>
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 10, 2026
@sbueringer
Copy link
Copy Markdown
Member

/ok-to-test
(not sure when I'll find time for review)

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area PR is missing an area label ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve validation in Cluster.spec.topology

3 participants