api icon indicating copy to clipboard operation
api copied to clipboard

OCPCLOUD-2710: Extend AWS metadata service options in MAPA

Open RadekManak opened this issue 1 month ago โ€ข 6 comments

Add httpEndpoint, httpPutResponseHopLimit, and instanceMetadataTags fields to MetadataServiceOptions to bring parity with CAPA. This allows users to configure additional aspects of the AWS Instance Metadata Service (IMDS) on machine instances, improving backwards compatibility and reducing conversion errors when these options are used in CAPA.

New fields:

  • httpEndpoint: Enable/disable HTTP metadata endpoint (Enabled/Disabled)
  • httpPutResponseHopLimit: Configure metadata token hop limit (1-64)
  • instanceMetadataTags: Enable/disable instance tag access from metadata

RadekManak avatar Jan 16 '26 15:01 RadekManak

Pipeline controller notification This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

openshift-ci-robot avatar Jan 16 '26 15:01 openshift-ci-robot

@RadekManak: This pull request references OCPCLOUD-2710 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.

In response to this:

Add httpEndpoint, httpPutResponseHopLimit, and instanceMetadataTags fields to MetadataServiceOptions to bring parity with CAPA. This allows users to configure additional aspects of the AWS Instance Metadata Service (IMDS) on machine instances, improving backwards compatibility and reducing conversion errors when these options are used in CAPA.

New fields:

  • httpEndpoint: Enable/disable HTTP metadata endpoint (Enabled/Disabled)
  • httpPutResponseHopLimit: Configure metadata token hop limit (1-64)
  • instanceMetadataTags: Enable/disable instance tag access from metadata

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 avatar Jan 16 '26 15:01 openshift-ci-robot

Hello @RadekManak! Some important instructions when contributing to openshift/api: API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

openshift-ci[bot] avatar Jan 16 '26 15:01 openshift-ci[bot]

๐Ÿ“ Walkthrough

Walkthrough

This pull request extends the MetadataServiceOptions structure in the AWS machine provider configuration by introducing three new fields and two new enum types. HTTPEndpointState and InstanceMetadataTagsState enums are added with Disabled and Enabled constants. The MetadataServiceOptions struct gains three new fields: HTTPEndpoint (HTTPEndpointState pointer), HTTPPutResponseHopLimit (int64 pointer), and InstanceMetadataTags (InstanceMetadataTagsState pointer). Corresponding generated files for deep copying, Swagger documentation, and OpenAPI schema definitions are updated to reflect these additions.

๐Ÿšฅ Pre-merge checks | โœ… 2 | โŒ 1
โŒ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage โš ๏ธ Warning Docstring coverage is 0.00% 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
Title check โœ… Passed The PR title clearly and specifically describes the main change: extending AWS metadata service options in MAPA to align with CAPA requirements.
Description check โœ… Passed The PR description directly addresses the changeset by explaining the three new fields being added to MetadataServiceOptions and their purpose for IMDS configuration.

โœ๏ธ Tip: You can configure your own custom pre-merge checks in the settings.

โœจ Finishing touches
  • [ ] ๐Ÿ“ Generate docstrings

๐Ÿงน Recent nitpick comments
machine/v1beta1/types_awsprovider.go (1)

301-309: Verify hop-limit marker syntax to ensure CRD validation is emitted.

Line 306-307 uses Minimum=1 / Maximum=64 while nearby validations use :=. Please confirm controller-tools accepts this form (or align to the := style) so the range is enforced.

๐Ÿ”ง Proposed alignment with existing marker style
-// +kubebuilder:validation:Minimum=1
-// +kubebuilder:validation:Maximum=64
+// +kubebuilder:validation:Minimum:=1
+// +kubebuilder:validation:Maximum:=64

๐Ÿ“œ Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between 36664f770c0a246350402ade9e76c5c5e184a0d9 and f685436b4ca4f8077ae110911fe238ded41662e3.

๐Ÿ“’ Files selected for processing (4)
  • machine/v1beta1/types_awsprovider.go
  • machine/v1beta1/zz_generated.deepcopy.go
  • machine/v1beta1/zz_generated.swagger_doc_generated.go
  • openapi/generated_openapi/zz_generated.openapi.go
๐Ÿงฐ Additional context used
๐Ÿงฌ Code graph analysis (1)
machine/v1beta1/zz_generated.deepcopy.go (1)
machine/v1beta1/types_awsprovider.go (3)
  • MetadataServiceOptions (290-334)
  • HTTPEndpointState (269-269)
  • InstanceMetadataTagsState (279-279)
๐Ÿ”‡ Additional comments (4)
machine/v1beta1/types_awsprovider.go (1)

268-286: IMDS enum additions are clear and consistent.

Line 268-286 adds typed states mirroring AWS values; this keeps the API explicit and readable.

machine/v1beta1/zz_generated.swagger_doc_generated.go (1)

147-153: Swagger docs updated for IMDS options.

Lines 147-153 reflect the new metadata fields and updated authentication semantics; matches the type changes.

machine/v1beta1/zz_generated.deepcopy.go (2)

82-82: DeepCopy now clones MetadataServiceOptions.

Line 82 switches to DeepCopyInto, preventing pointer aliasing after adding optional IMDS fields.


1484-1499: DeepCopy handles new IMDS fields correctly.

Line 1485-1499 allocates and copies the new pointer fields as expected.

โœ๏ธ Tip: You can disable this entire section by setting review_details to false in your review settings.

[!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)

Error: build linters: unable to load custom analyzer "kubeapilinter": tools/_output/bin/kube-api-linter.so, plugin: not implemented The command is terminated due to an error: build linters: unable to load custom analyzer "kubeapilinter": tools/_output/bin/kube-api-linter.so, plugin: not implemented


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

coderabbitai[bot] avatar Jan 16 '26 15:01 coderabbitai[bot]

[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 everettraven for approval. For more information see the Code Review Process.

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

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[bot] avatar Jan 16 '26 15:01 openshift-ci[bot]

@RadekManak: all tests passed!

Full PR test history. Your PR dashboard.

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[bot] avatar Jan 16 '26 15:01 openshift-ci[bot]