Skip to content

SPLAT-2680: Changed DHA to require hostAffinity=host#1484

Open
vr4manta wants to merge 1 commit intoopenshift:mainfrom
vr4manta:SPLAT-2680
Open

SPLAT-2680: Changed DHA to require hostAffinity=host#1484
vr4manta wants to merge 1 commit intoopenshift:mainfrom
vr4manta:SPLAT-2680

Conversation

@vr4manta
Copy link
Contributor

@vr4manta vr4manta commented Mar 20, 2026

SPLAT-2680

Changes

  • Changed DHA logic to require hostAffinity=host so instances do not drift off of the allocated host when restarted

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 20, 2026

@vr4manta: This pull request references SPLAT-2680 which is a valid jira issue.

Details

In response to this:

SPLAT-2680

Changes

  • Changed DHA logic to require hostAffinity=host so instances do not drift off of the allocated host when restarted

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.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 20, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f2eaf7c5-3f47-4fdb-8e9c-0b7173d6d8fd

📥 Commits

Reviewing files that changed from the base of the PR and between 221c405 and 453cf66.

📒 Files selected for processing (2)
  • pkg/webhooks/machine_webhook.go
  • pkg/webhooks/machine_webhook_test.go

Walkthrough

Added validation in AWS placement tenancy processing to enforce that when dynamic host allocation strategy is used, the host affinity must be configured as DedicatedHost rather than HostAffinityAnyAvailable. The validation appends a field error if this constraint is violated. Corresponding test cases were updated to expect the new validation error.

Changes

Cohort / File(s) Summary
Webhook Validation
pkg/webhooks/machine_webhook.go
Added validation in processAWSPlacementTenancy to check that when spec.placement.host.dedicatedHost is set with dynamic allocation strategy, the host affinity must be DedicatedHost and not HostAffinityAnyAvailable.
Test Updates
pkg/webhooks/machine_webhook_test.go
Updated two test case expectations to reflect the new validation behavior; cases with AnyAvailable affinity and dynamic allocation strategy now correctly expect admission denial with the constraint error message.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.3)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 20, 2026

@vr4manta: This pull request references SPLAT-2680 which is a valid jira issue.

Details

In response to this:

SPLAT-2680

Changes

  • Changed DHA logic to require hostAffinity=host so instances do not drift off of the allocated host when restarted

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.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 20, 2026

[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 mdbooth 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

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 20, 2026

@vr4manta: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-metal-ipi-virtualmedia 453cf66 link true /test e2e-metal-ipi-virtualmedia
ci/prow/e2e-metal-ipi-ovn-ipv6 453cf66 link true /test e2e-metal-ipi-ovn-ipv6

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants