Skip to content

Conversation

@vr4manta
Copy link

@vr4manta vr4manta commented Oct 1, 2025

SPLAT-2167

Changes

  • Added dedicated host support for AWS
  • Created new dedicated host tests
  • Fixed tests that were breaking due to updates upstream that were pulled in
  • Added missing permission ec2:DescribeInstanceTypes to cluster api credentials request

Dependencies

Notes

There seems to be a required permission that was missing for dedicated host support. When running these changes, a warning event was observed in the cluster capi operator namespace.

6s          Warning   FailedDescribeInstanceTypes   awscluster/ngirard-dh-5bb5w                           insufficient permissions to describe instance types for instance type "m6i.xlarge", falling back to the default architecture of "x86_64": operation error EC2: DescribeInstanceTypes, https response error StatusCode: 403, RequestID: 387549b4-ab58-48af-b14d-3882b6c7da52, api error UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:iam::726924432237:user/ngirard-dh-5bb5w-openshift-cluster-api-aws-72f7q is not authorized to perform: ec2:DescribeInstanceTypes because no identity-based policy allows the ec2:DescribeInstanceTypes action

Summary by CodeRabbit

  • New Features

    • Added AWS dedicated-host support with tenancy modes ("default", "dedicated", "host"), HostID validation, and deterministic dynamic host-allocation tag ordering.
  • Security / Permissions

    • AWS credentials policy expanded to allow instance-type discovery (ec2:DescribeInstanceTypes).
  • Tests

    • Expanded conversion and fuzz tests for host-affinity, HostID formats, dynamic host allocation, and validation cases.
  • Bug Fixes

    • Infra diffs now include host-affinity and HostID, enabling drift detection.
  • Chores

    • Dependency/module version updates.

✏️ Tip: You can customize this high-level summary in your review settings.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Oct 1, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 1, 2025

@vr4manta: This pull request references SPLAT-2167 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 "4.21.0" version, but no target version was set.

Details

In response to this:

SPLAT-2167

Changes

  • Added dedicated host support for AWS

Dependencies

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 openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 1, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 1, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai
Copy link

coderabbitai bot commented Oct 1, 2025

📝 Walkthrough

Walkthrough

Adds AWS dedicated-host placement support across CAPA↔MAPI conversions, extends fuzz and unit tests for placement scenarios, re-enables host field diffing in infra comparisons, bumps several module deps, and adds ec2:DescribeInstanceTypes to the credentials-request.

Changes

Cohort / File(s) Summary
Credentials Request
manifests/0000_30_cluster-api_01_credentials-request.yaml
Added ec2:DescribeInstanceTypes to AWS provider IAM actions.
CAPA → MAPI conversion
pkg/conversion/capi2mapi/aws.go, pkg/conversion/capi2mapi/aws_fuzz_test.go, pkg/conversion/capi2mapi/aws_test.go
Add dedicated-host support: tenancy constants (TenancyDefault, TenancyDedicated, TenancyHost), HostID regex and validation, host-affinity conversion helpers, deterministic tag sorting, integrate placement into toProviderSpec/status, and expand fuzz/tests for HostAffinity/HostID cases.
MAPI → CAPA conversion
pkg/conversion/mapi2capi/aws.go, pkg/conversion/mapi2capi/aws_fuzz_test.go, pkg/conversion/mapi2capi/aws_test.go
Implement conversion helpers to map MAPI placement → CAPA fields (HostAffinity, HostID, DynamicHostAllocation); populate AWSMachineSpec/status from placement; add fuzzPlacement and placement tests; sort dynamic allocation tags.
Controllers — machineset / machinesync
pkg/controllers/machinesetsync/machineset_sync_controller.go, pkg/controllers/machinesync/machine_sync_mapi2capi_infrastructure.go
Removed diff-ignore options for AWS spec.hostID and spec.hostAffinity; these fields are now considered in infra template and infra machine comparisons.
Module updates
go.mod, e2e/go.mod, hack/tools/go.mod
Bumped sigs.k8s.io/cluster-api-provider-aws version, added a replace for github.com/openshift/api, and bumped kustomize/tool versions in hack/tools/go.mod.

Sequence Diagram(s)

sequenceDiagram
  participant CAPA as CAPA AWSMachine
  participant C2M as capi2mapi.converter
  participant MAPI as MAPI ProviderConfig/Placement
  participant M2C as mapi2capi.converter
  participant Controller as machineset/machinesync

  CAPA->>C2M: provide AWSMachineSpec (Tenancy, HostAffinity, HostID, DynamicHostAllocation)
  C2M->>MAPI: convert to ProviderConfig.Placement and ProviderStatus.DedicatedHost
  MAPI->>M2C: expose ProviderConfig.Placement
  M2C->>CAPA: convert Placement back to AWSMachineSpec/Status
  Controller->>MAPI: compute diffs (includes hostID/hostAffinity)
  Controller->>Controller: act on drift/updates
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 I hopped through specs and regex with glee,

Mapped HostAffinity, HostID, tags in a spree,
Fuzzers twirled through eight playful ways,
Diffs now mind hosts by nights and days,
A tiny rabbit patch, neat as can be.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 63.85% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'SPLAT-2167: Added dedicated host support for AWS' accurately and directly describes the main changes across multiple files involving AWS dedicated host support, conversion logic, and validation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.5.0)

/bin/bash: line 1: golangci-lint: command not found


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

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 1, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 1, 2025

@vr4manta: This pull request references SPLAT-2167 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 "4.21.0" version, but no target version was set.

Details

In response to this:

SPLAT-2167

Changes

  • Added dedicated host support for AWS

Dependencies

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-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 1, 2025
@vr4manta vr4manta force-pushed the SPLAT-2167 branch 2 times, most recently from 6355141 to 7ba97c3 Compare November 10, 2025 16:22
@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 11, 2025

@vr4manta: This pull request references SPLAT-2167 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 "4.21.0" version, but no target version was set.

Details

In response to this:

SPLAT-2167

Changes

  • Added dedicated host support for AWS

Dependencies

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.

@vr4manta vr4manta force-pushed the SPLAT-2167 branch 2 times, most recently from dc53d82 to e5cbce2 Compare November 11, 2025 17:16
@vr4manta
Copy link
Author

/test all

@vr4manta
Copy link
Author

/test all

@vr4manta vr4manta force-pushed the SPLAT-2167 branch 2 times, most recently from ed41da7 to 320eac0 Compare November 13, 2025 14:40
@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 13, 2025

@vr4manta: This pull request references SPLAT-2167 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 "4.21.0" version, but no target version was set.

Details

In response to this:

SPLAT-2167

Changes

  • Added dedicated host support for AWS

Dependencies

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.

- ec2:DescribeDhcpOptions
- ec2:DescribeImages
- ec2:DescribeInstances
- ec2:DescribeInstanceTypes
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it would be nice to add this change to a new commit referencing the reason of adding it (upstream PR, jira feature, etc).

this would be used to document in the future and/or in managed services to eventually update the managed IAM.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! There is a warning message that is caused by this missing. I am not 100% sure this feature introduced it, but I am happy to put into a separate commit.

mapaProviderConfig.HostPlacement = &mapiv1beta1.HostPlacement{
Affinity: ptr.To(mapiv1beta1.HostAffinityDedicatedHost),
DedicatedHost: &mapiv1beta1.DedicatedHost{
ID: *m.awsMachine.Spec.HostID,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to check HostID isnt nil to be safe or is there already a previous validation of this scenario?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question. lots of these CRs have checks in their respective webhooks / CRDs. I can add a check here as well. I was on the fence about it.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 14, 2025

@vr4manta: This pull request references SPLAT-2167 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 "4.21.0" version, but no target version was set.

Details

In response to this:

SPLAT-2167

Changes

  • Added dedicated host support for AWS
  • Created new dedicated host tests
  • Fixed tests that were breaking due to updates upstream that were pulled in
  • Added missing permission ec2:DescribeInstanceTypes to cluster api credentials request

Dependencies

Notes

There seems to be a required permission that was missing for dedicated host support. When running these changes, a warning event was observed in the cluster capi operator namespace.

6s          Warning   FailedDescribeInstanceTypes   awscluster/ngirard-dh-5bb5w                           insufficient permissions to describe instance types for instance type "m6i.xlarge", falling back to the default architecture of "x86_64": operation error EC2: DescribeInstanceTypes, https response error StatusCode: 403, RequestID: 387549b4-ab58-48af-b14d-3882b6c7da52, api error UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:iam::726924432237:user/ngirard-dh-5bb5w-openshift-cluster-api-aws-72f7q is not authorized to perform: ec2:DescribeInstanceTypes because no identity-based policy allows the ec2:DescribeInstanceTypes action

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.

@vr4manta vr4manta marked this pull request as ready for review November 14, 2025 13:15
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 14, 2025
@huali9
Copy link
Contributor

huali9 commented Jan 14, 2026

Thank you @vr4manta , I checked @damdo 's pr kubernetes-sigs/cluster-api-provider-aws#5801 seems only set hostAffinity=default is a valid value.
And I tried creating CAPI machine set with hostAffinity=default alone, the machine get Running, but when migrate to MAPI, it still met error. I recorded in the test case red background word part, could you please help to take a look? Thanks!

  - lastTransitionTime: "2026-01-14T05:38:48Z"
    message: 'failed to update MAPI machine set: admission webhook "validation.machineset.machine.openshift.io"
      denied the request: spec.placement.host: Forbidden: host may only be specified
      when tenancy is ''host'''
    reason: FailedToUpdateMAPIMachineSet
    severity: Error
    status: "False"
    type: Synchronized

@vr4manta
Copy link
Author

Thank you @vr4manta , I checked @damdo 's pr kubernetes-sigs/cluster-api-provider-aws#5801 seems only set hostAffinity=default is a valid value. And I tried creating CAPI machine set with hostAffinity=default alone, the machine get Running, but when migrate to MAPI, it still met error. I recorded in the test case red background word part, could you please help to take a look? Thanks!

  - lastTransitionTime: "2026-01-14T05:38:48Z"
    message: 'failed to update MAPI machine set: admission webhook "validation.machineset.machine.openshift.io"
      denied the request: spec.placement.host: Forbidden: host may only be specified
      when tenancy is ''host'''
    reason: FailedToUpdateMAPIMachineSet
    severity: Error
    status: "False"
    type: Synchronized

do we log the resulting values? I think its creating "" versions of the field which makes it not != null. I can add a check to ignore "" as well in that case. I'll also take a deeper look to see what else we can do to fix the conversions.

@huali9
Copy link
Contributor

huali9 commented Jan 15, 2026

Thank you @vr4manta I created a bug https://issues.redhat.com/browse/OCPBUGS-73821 to better trace the issue and attached the details on that.

@huali9
Copy link
Contributor

huali9 commented Jan 15, 2026

@vr4manta I noticed you submitted a PR to modify MAPI. However, I'm wondering if we should modify CAPI instead? Because configuring hostAffinity=default alone in CAPI doesn't have any effect on the AWS side.

I also tested this directly with AWS, and setting only Affinity=default is not allowed:

(my_virtualenv) liuhuali@Lius-MacBook-Pro ~ % AWS_PROFILE=saml aws ec2 run-instances --region us-east-2 \
    --image-id ami-0bc8dda494f111572 --count 1 \
    --instance-type m6i.xlarge --key-name huliu-testdns \
    --security-group-ids sg-0d65b14a8ccd244cf sg-0bd10eeaf07acbf20 \
    --subnet-id subnet-03045088d51981a3f \
    --placement Affinity=default

An error occurred (InvalidParameterCombination) when calling the RunInstances operation: The parameter affinity cannot be used without specifying a tenancy of 'host'

This confirms that Affinity requires Tenancy=host to be set as well. We should align with AWS's behavior, shouldn't we?

@vr4manta
Copy link
Author

@vr4manta I noticed you submitted a PR to modify MAPI. However, I'm wondering if we should modify CAPI instead? Because configuring hostAffinity=default alone in CAPI doesn't have any effect on the AWS side.

I also tested this directly with AWS, and setting only Affinity=default is not allowed:

(my_virtualenv) liuhuali@Lius-MacBook-Pro ~ % AWS_PROFILE=saml aws ec2 run-instances --region us-east-2 \
    --image-id ami-0bc8dda494f111572 --count 1 \
    --instance-type m6i.xlarge --key-name huliu-testdns \
    --security-group-ids sg-0d65b14a8ccd244cf sg-0bd10eeaf07acbf20 \
    --subnet-id subnet-03045088d51981a3f \
    --placement Affinity=default

An error occurred (InvalidParameterCombination) when calling the RunInstances operation: The parameter affinity cannot be used without specifying a tenancy of 'host'

This confirms that Affinity requires Tenancy=host to be set as well. We should align with AWS's behavior, shouldn't we?

I agree this should be fixed upstream. The other PR is to make the two match since its broke now. It will take sprints / months to get this backported into the openshift/cluster-api-provider-aws. Once fixed, we can make match so there isn't breakage this this lasting during development. But I'll discuss with @damdo what options we have and i'll update this PR with the results.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 16, 2026

@vr4manta: This pull request references SPLAT-2167 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 "4.22.0" version, but no target version was set.

Details

In response to this:

SPLAT-2167

Changes

  • Added dedicated host support for AWS
  • Created new dedicated host tests
  • Fixed tests that were breaking due to updates upstream that were pulled in
  • Added missing permission ec2:DescribeInstanceTypes to cluster api credentials request

Dependencies

Notes

There seems to be a required permission that was missing for dedicated host support. When running these changes, a warning event was observed in the cluster capi operator namespace.

6s          Warning   FailedDescribeInstanceTypes   awscluster/ngirard-dh-5bb5w                           insufficient permissions to describe instance types for instance type "m6i.xlarge", falling back to the default architecture of "x86_64": operation error EC2: DescribeInstanceTypes, https response error StatusCode: 403, RequestID: 387549b4-ab58-48af-b14d-3882b6c7da52, api error UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:iam::726924432237:user/ngirard-dh-5bb5w-openshift-cluster-api-aws-72f7q is not authorized to perform: ec2:DescribeInstanceTypes because no identity-based policy allows the ec2:DescribeInstanceTypes action

Summary by CodeRabbit

  • New Features

  • Added AWS dedicated-host support with configurable affinity modes ("default", "host") and host identifier validation.

  • Security / Permissions

  • AWS credentials policy expanded to allow instance-type discovery (ec2:DescribeInstanceTypes).

  • Tests

  • Expanded conversion and fuzzing tests covering host-affinity, host-ID validation, and related error cases.

  • Chores

  • Dependency and module version updates for build/test tooling.

✏️ Tip: You can customize this high-level summary in your review settings.

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.

@vr4manta
Copy link
Author

Created upstream PR to fix CAPA to match AWS cli.

@vr4manta
Copy link
Author

since this PR is on hold, I am updating it to support dynamic DH support since we are waiting on upstream CAPA fixes landing into OCP fork.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 27, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 27, 2026

New changes are detected. LGTM label has been removed.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 27, 2026

@vr4manta: This pull request references SPLAT-2167 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 "4.22.0" version, but no target version was set.

Details

In response to this:

SPLAT-2167

Changes

  • Added dedicated host support for AWS
  • Created new dedicated host tests
  • Fixed tests that were breaking due to updates upstream that were pulled in
  • Added missing permission ec2:DescribeInstanceTypes to cluster api credentials request

Dependencies

Notes

There seems to be a required permission that was missing for dedicated host support. When running these changes, a warning event was observed in the cluster capi operator namespace.

6s          Warning   FailedDescribeInstanceTypes   awscluster/ngirard-dh-5bb5w                           insufficient permissions to describe instance types for instance type "m6i.xlarge", falling back to the default architecture of "x86_64": operation error EC2: DescribeInstanceTypes, https response error StatusCode: 403, RequestID: 387549b4-ab58-48af-b14d-3882b6c7da52, api error UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:iam::726924432237:user/ngirard-dh-5bb5w-openshift-cluster-api-aws-72f7q is not authorized to perform: ec2:DescribeInstanceTypes because no identity-based policy allows the ec2:DescribeInstanceTypes action

Summary by CodeRabbit

  • New Features

  • Added AWS dedicated-host support with tenancy modes ("default", "dedicated", "host") and HostID validation.

  • Security / Permissions

  • AWS credentials policy expanded to allow instance-type discovery (ec2:DescribeInstanceTypes).

  • Tests

  • Expanded conversion and fuzzing tests for host-affinity, HostID formats, dynamic host allocation, and related validations.

  • Bug Fixes

  • Infra diffs now include host-affinity and HostID, enabling drift detection for those fields.

  • Chores

  • Dependency/module version updates for tooling and provider.

✏️ Tip: You can customize this high-level summary in your review settings.

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@pkg/conversion/mapi2capi/aws_fuzz_test.go`:
- Around line 187-252: The provider-config filler uses c.FillNoCustom(ps) in
fuzzProviderConfig which bypasses custom funcs so fuzzPlacement never runs for
AWSMachineProviderConfig; call f.fuzzPlacement(&ps.Placement, c) from
fuzzProviderConfig (before you reset ps.Region) to explicitly apply placement
fuzzing for the Placement field (ensure you reference fuzzPlacement,
fuzzProviderConfig, FillNoCustom, and ps.Placement when making the change).

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 28, 2026

@vr4manta: This pull request references SPLAT-2167 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 "4.22.0" version, but no target version was set.

Details

In response to this:

SPLAT-2167

Changes

  • Added dedicated host support for AWS
  • Created new dedicated host tests
  • Fixed tests that were breaking due to updates upstream that were pulled in
  • Added missing permission ec2:DescribeInstanceTypes to cluster api credentials request

Dependencies

Notes

There seems to be a required permission that was missing for dedicated host support. When running these changes, a warning event was observed in the cluster capi operator namespace.

6s          Warning   FailedDescribeInstanceTypes   awscluster/ngirard-dh-5bb5w                           insufficient permissions to describe instance types for instance type "m6i.xlarge", falling back to the default architecture of "x86_64": operation error EC2: DescribeInstanceTypes, https response error StatusCode: 403, RequestID: 387549b4-ab58-48af-b14d-3882b6c7da52, api error UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:iam::726924432237:user/ngirard-dh-5bb5w-openshift-cluster-api-aws-72f7q is not authorized to perform: ec2:DescribeInstanceTypes because no identity-based policy allows the ec2:DescribeInstanceTypes action

Summary by CodeRabbit

  • New Features

  • Added AWS dedicated-host support with tenancy modes and HostID validation; deterministic ordering for host allocation tags.

  • Security / Permissions

  • AWS credentials policy expanded to allow instance-type discovery (ec2:DescribeInstanceTypes).

  • Tests

  • Expanded conversion and fuzzing tests for host-affinity, HostID formats, dynamic host allocation, and related validations.

  • Bug Fixes

  • Infra diffs now include host-affinity and HostID, enabling drift detection for those fields.

  • Chores

  • Dependency/module version updates for tooling and provider.

✏️ Tip: You can customize this high-level summary in your review settings.

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
Copy link

openshift-ci-robot commented Jan 28, 2026

@vr4manta: This pull request references SPLAT-2167 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 "4.22.0" version, but no target version was set.

Details

In response to this:

SPLAT-2167

Changes

  • Added dedicated host support for AWS
  • Created new dedicated host tests
  • Fixed tests that were breaking due to updates upstream that were pulled in
  • Added missing permission ec2:DescribeInstanceTypes to cluster api credentials request

Dependencies

Notes

There seems to be a required permission that was missing for dedicated host support. When running these changes, a warning event was observed in the cluster capi operator namespace.

6s          Warning   FailedDescribeInstanceTypes   awscluster/ngirard-dh-5bb5w                           insufficient permissions to describe instance types for instance type "m6i.xlarge", falling back to the default architecture of "x86_64": operation error EC2: DescribeInstanceTypes, https response error StatusCode: 403, RequestID: 387549b4-ab58-48af-b14d-3882b6c7da52, api error UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:iam::726924432237:user/ngirard-dh-5bb5w-openshift-cluster-api-aws-72f7q is not authorized to perform: ec2:DescribeInstanceTypes because no identity-based policy allows the ec2:DescribeInstanceTypes action

Summary by CodeRabbit

  • New Features

  • Added AWS dedicated-host support with tenancy modes ("default", "dedicated", "host") and HostID validation, plus deterministic tag ordering for host allocation.

  • Security / Permissions

  • AWS credentials policy expanded to allow instance-type discovery (ec2:DescribeInstanceTypes).

  • Tests

  • Expanded conversion and fuzzing tests covering host-affinity, HostID formats, dynamic host allocation, and validation scenarios.

  • Bug Fixes

  • Infra diffs now include host-affinity and HostID, enabling drift detection.

  • Chores

  • Dependency/module version updates.

✏️ Tip: You can customize this high-level summary in your review settings.

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@pkg/conversion/capi2mapi/aws.go`:
- Around line 283-326: In convertHostAffinityHost, when validating a provided
HostID (hasHostID branch) replace the incorrect error symbol errHostIDRequired
with errHostIDInvalidFormat so the field.Invalid call on
fldPath.Child("dedicatedHost").Child("id") returns the accurate "invalid format"
error (this mirrors the usage in convertHostAffinityDefault); update the
field.Invalid invocation to reference errHostIDInvalidFormat for the HostID
format check.
🧹 Nitpick comments (1)
pkg/conversion/mapi2capi/aws.go (1)

463-469: Potential side effect: sorting modifies the original slice in the unmarshaled spec.

The tags variable is assigned directly from the spec's slice, so sort.Slice(tags, ...) mutates the original spec.Placement.Host.DedicatedHost.DynamicHostAllocation.Tags slice. While this achieves deterministic ordering before returning, it modifies the input data as a side effect. If callers expect the returned spec to be unchanged elsewhere, this could cause subtle issues.

Consider whether this is intentional. If so, a brief comment documenting this behavior would help future readers.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 28, 2026

@vr4manta: This pull request references SPLAT-2167 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 "4.22.0" version, but no target version was set.

Details

In response to this:

SPLAT-2167

Changes

  • Added dedicated host support for AWS
  • Created new dedicated host tests
  • Fixed tests that were breaking due to updates upstream that were pulled in
  • Added missing permission ec2:DescribeInstanceTypes to cluster api credentials request

Dependencies

Notes

There seems to be a required permission that was missing for dedicated host support. When running these changes, a warning event was observed in the cluster capi operator namespace.

6s          Warning   FailedDescribeInstanceTypes   awscluster/ngirard-dh-5bb5w                           insufficient permissions to describe instance types for instance type "m6i.xlarge", falling back to the default architecture of "x86_64": operation error EC2: DescribeInstanceTypes, https response error StatusCode: 403, RequestID: 387549b4-ab58-48af-b14d-3882b6c7da52, api error UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:iam::726924432237:user/ngirard-dh-5bb5w-openshift-cluster-api-aws-72f7q is not authorized to perform: ec2:DescribeInstanceTypes because no identity-based policy allows the ec2:DescribeInstanceTypes action

Summary by CodeRabbit

  • New Features

  • Added AWS dedicated-host support with tenancy modes ("default", "dedicated", "host"), HostID validation, and deterministic dynamic host-allocation tag ordering.

  • Security / Permissions

  • AWS credentials policy expanded to allow instance-type discovery (ec2:DescribeInstanceTypes).

  • Tests

  • Expanded conversion and fuzzing tests for host-affinity, HostID formats, dynamic host allocation, and validation cases.

  • Bug Fixes

  • Infra diffs now include host-affinity and HostID, enabling drift detection.

  • Chores

  • Dependency/module version updates.

✏️ Tip: You can customize this high-level summary in your review settings.

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@pkg/conversion/capi2mapi/aws.go`:
- Around line 328-357: convertHostAffinityDefault currently returns nil on an
invalid HostID but returns a partial host when DynamicHostAllocation is invalid;
make the behavior consistent by returning nil whenever there are any validation
errors. In practice, keep the field.Invalid calls for HostID and
DynamicHostAllocation as-is (references: spec.HostID,
awsDedicatedHostNamePattern, spec.DynamicHostAllocation,
fldPath.Child("dedicatedHost").Child("id"),
fldPath.Child("dynamicHostAllocation")), then before the final return check if
errorList is non-empty and if so return nil, errorList; otherwise return host,
errorList.
🧹 Nitpick comments (1)
pkg/conversion/capi2mapi/aws.go (1)

59-65: Consider using the new tenancy constants in convertAWSTenancyToMAPI.

The new TenancyDefault, TenancyDedicated, and TenancyHost constants (lines 60-64) duplicate the string literals used in convertAWSTenancyToMAPI (lines 621-625). Using the constants would improve consistency and reduce the risk of typos.

Suggested refactor
 func convertAWSTenancyToMAPI(fldPath *field.Path, capiTenancy string) (mapiv1beta1.InstanceTenancy, *field.Error) {
 	switch capiTenancy {
-	case "default":
+	case TenancyDefault:
 		return mapiv1beta1.DefaultTenancy, nil
-	case "dedicated":
+	case TenancyDedicated:
 		return mapiv1beta1.DedicatedTenancy, nil
-	case "host":
+	case TenancyHost:
 		return mapiv1beta1.HostTenancy, nil
 	case "":
 		return "", nil
 	default:
 		return "", field.Invalid(fldPath, capiTenancy, errUnsupportedCAPATenancy)
 	}
 }

Also applies to: 619-632

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 28, 2026

@vr4manta: This pull request references SPLAT-2167 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 "4.22.0" version, but no target version was set.

Details

In response to this:

SPLAT-2167

Changes

  • Added dedicated host support for AWS
  • Created new dedicated host tests
  • Fixed tests that were breaking due to updates upstream that were pulled in
  • Added missing permission ec2:DescribeInstanceTypes to cluster api credentials request

Dependencies

Notes

There seems to be a required permission that was missing for dedicated host support. When running these changes, a warning event was observed in the cluster capi operator namespace.

6s          Warning   FailedDescribeInstanceTypes   awscluster/ngirard-dh-5bb5w                           insufficient permissions to describe instance types for instance type "m6i.xlarge", falling back to the default architecture of "x86_64": operation error EC2: DescribeInstanceTypes, https response error StatusCode: 403, RequestID: 387549b4-ab58-48af-b14d-3882b6c7da52, api error UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:iam::726924432237:user/ngirard-dh-5bb5w-openshift-cluster-api-aws-72f7q is not authorized to perform: ec2:DescribeInstanceTypes because no identity-based policy allows the ec2:DescribeInstanceTypes action

Summary by CodeRabbit

  • New Features

  • Added AWS dedicated-host support with tenancy modes ("default", "dedicated", "host"), HostID validation, and deterministic dynamic host-allocation tag ordering.

  • Security / Permissions

  • AWS credentials policy expanded to allow instance-type discovery (ec2:DescribeInstanceTypes).

  • Tests

  • Expanded conversion and fuzz tests covering host-affinity, HostID formats, dynamic host allocation, and validation scenarios.

  • Bug Fixes

  • Infra diffs now include host-affinity and HostID, enabling drift detection.

  • Chores

  • Dependency/module version updates.

✏️ Tip: You can customize this high-level summary in your review settings.

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 Jan 28, 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/okd-scos-e2e-aws-ovn 3820d2b link false /test okd-scos-e2e-aws-ovn
ci/prow/e2e-aws-capi-techpreview 4be065e link true /test e2e-aws-capi-techpreview
ci/prow/e2e-aws-ovn-serial-1of2 4be065e link true /test e2e-aws-ovn-serial-1of2
ci/prow/e2e-metal3-capi-techpreview 4be065e link false /test e2e-metal3-capi-techpreview
ci/prow/e2e-azure-ovn-techpreview 4be065e link false /test e2e-azure-ovn-techpreview

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.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jan 29, 2026

@vr4manta: This pull request references SPLAT-2167 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 "4.22.0" version, but no target version was set.

Details

In response to this:

SPLAT-2167

Changes

  • Added dedicated host support for AWS
  • Created new dedicated host tests
  • Fixed tests that were breaking due to updates upstream that were pulled in
  • Added missing permission ec2:DescribeInstanceTypes to cluster api credentials request

Dependencies

Notes

There seems to be a required permission that was missing for dedicated host support. When running these changes, a warning event was observed in the cluster capi operator namespace.

6s          Warning   FailedDescribeInstanceTypes   awscluster/ngirard-dh-5bb5w                           insufficient permissions to describe instance types for instance type "m6i.xlarge", falling back to the default architecture of "x86_64": operation error EC2: DescribeInstanceTypes, https response error StatusCode: 403, RequestID: 387549b4-ab58-48af-b14d-3882b6c7da52, api error UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:iam::726924432237:user/ngirard-dh-5bb5w-openshift-cluster-api-aws-72f7q is not authorized to perform: ec2:DescribeInstanceTypes because no identity-based policy allows the ec2:DescribeInstanceTypes action

Summary by CodeRabbit

  • New Features

  • Added AWS dedicated-host support with tenancy modes ("default", "dedicated", "host"), HostID validation, and deterministic dynamic host-allocation tag ordering.

  • Security / Permissions

  • AWS credentials policy expanded to allow instance-type discovery (ec2:DescribeInstanceTypes).

  • Tests

  • Expanded conversion and fuzz tests for host-affinity, HostID formats, dynamic host allocation, and validation cases.

  • Bug Fixes

  • Infra diffs now include host-affinity and HostID, enabling drift detection.

  • Chores

  • Dependency/module version updates.

✏️ Tip: You can customize this high-level summary in your review settings.

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.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 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.

9 participants