Skip to content

CORS-4337: allow AWS Europe Sovereign Cloud partition#2708

Open
tthvo wants to merge 1 commit intoopenshift:masterfrom
tthvo:CORS-4337
Open

CORS-4337: allow AWS Europe Sovereign Cloud partition#2708
tthvo wants to merge 1 commit intoopenshift:masterfrom
tthvo:CORS-4337

Conversation

@tthvo
Copy link
Member

@tthvo tthvo commented Feb 14, 2026

According to AWS docs, ARNs in AWS European Sovereign Cloud begin with

arn:aws-eusc:

Thus, to support EUS Cloud, we need to update the validation to allow this new format.

In AWS European Sovereign Cloud, ARNs begin with "arn:aws-eusc:". Thus,
we need to update the validation to allow this new format.

See https://docs.aws.eu/general/latest/gr/arns.html
@openshift-ci-robot
Copy link

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 openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 14, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 14, 2026

@tthvo: This pull request references CORS-4337 which is a valid jira issue.

Details

In response to this:

According to AWS docs, ARNs in AWS European Sovereign Cloud begin with

arn:aws-eusc:

Thus, to support EUS Cloud, we need to update the validation to allow this new format.

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 Feb 14, 2026

Hello @tthvo! 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 openshift-ci bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 14, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 14, 2026

📝 Walkthrough

Walkthrough

This change extends AWS partition support across the codebase to include aws-eusc (AWS Europe/EU-SC) in addition to existing partitions (aws, aws-cn, aws-us-gov). The modification updates AWS ARN validation patterns, test cases, and documentation to accommodate the new partition. Specifically, regex patterns in DNS and KMS configuration validation are updated, test cases are added to verify functionality across all supported partitions, and CRD schemas are revised to reflect the expanded ARN format with explicit partition notation.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'CORS-4337: allow AWS Europe Sovereign Cloud partition' directly and clearly describes the main change—adding support for the aws-eusc partition in AWS ARN validation.
Description check ✅ Passed The description explains that AWS European Sovereign Cloud ARNs use the 'arn:aws-eusc:' prefix and that the PR updates validation to support this format, which aligns with the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into master

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

❤️ Share

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

@qodo-code-review
Copy link

Review Summary by Qodo

Support AWS Europe Sovereign Cloud partition in ARN validation

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add support for AWS Europe Sovereign Cloud partition (aws-eusc)
• Update ARN validation patterns for DNS and KMS configurations
• Add comprehensive test cases for all AWS partitions
• Update documentation and generated manifests
Diagram
flowchart LR
  A["AWS Partitions<br/>aws, aws-cn, aws-us-gov, aws-eusc"] -->|Update Validation| B["DNS IAM Role ARN"]
  A -->|Update Validation| C["KMS Key ARN"]
  B -->|Pattern Match| D["^arn:partition:iam::account:role/.*$"]
  C -->|Pattern Match| E["^arn:partition:kms:region:account:key/id$"]
  B -->|Test Cases| F["All Partitions Validated"]
  C -->|Test Cases| F
Loading

Grey Divider

File Changes

1. config/v1/types_dns.go ✨ Enhancement +1/-1

Add aws-eusc partition to DNS IAM role validation

config/v1/types_dns.go


2. config/v1/types_kmsencryption.go ✨ Enhancement +3/-2

Update KMS ARN format to support all AWS partitions

config/v1/types_kmsencryption.go


3. config/v1/zz_generated.swagger_doc_generated.go 📝 Documentation +1/-1

Update generated swagger documentation for KMS config

config/v1/zz_generated.swagger_doc_generated.go


View more (35)
4. openapi/generated_openapi/zz_generated.openapi.go 📝 Documentation +1/-1

Update generated OpenAPI schema for KMS config

openapi/generated_openapi/zz_generated.openapi.go


5. config/v1/tests/apiservers.config.openshift.io/KMSEncryptionProvider.yaml 🧪 Tests +89/-1

Add test cases for all AWS partition KMS configurations

config/v1/tests/apiservers.config.openshift.io/KMSEncryptionProvider.yaml


6. config/v1/tests/dnses.config.openshift.io/AAA_ungated.yaml 🧪 Tests +64/-1

Add test cases for all AWS partition DNS IAM roles

config/v1/tests/dnses.config.openshift.io/AAA_ungated.yaml


7. config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-CustomNoUpgrade.crd.yaml ⚙️ Configuration changes +4/-3

Update CRD manifest with new partition validation rule

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-CustomNoUpgrade.crd.yaml


8. config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-DevPreviewNoUpgrade.crd.yaml ⚙️ Configuration changes +4/-3

Update CRD manifest with new partition validation rule

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-DevPreviewNoUpgrade.crd.yaml


9. config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses.crd.yaml ⚙️ Configuration changes +1/-1

Update DNS CRD manifest with aws-eusc partition support

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses.crd.yaml


10. config/v1/zz_generated.featuregated-crd-manifests/apiservers.config.openshift.io/KMSEncryptionProvider.yaml ⚙️ Configuration changes +4/-3

Update feature-gated CRD manifest for KMS encryption

config/v1/zz_generated.featuregated-crd-manifests/apiservers.config.openshift.io/KMSEncryptionProvider.yaml


11. config/v1/zz_generated.featuregated-crd-manifests/dnses.config.openshift.io/AAA_ungated.yaml ⚙️ Configuration changes +1/-1

Update feature-gated DNS CRD manifest

config/v1/zz_generated.featuregated-crd-manifests/dnses.config.openshift.io/AAA_ungated.yaml


12. machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_controllerconfigs-CustomNoUpgrade.crd.yaml ⚙️ Configuration changes +1/-1

Update machine config CRD with aws-eusc partition

machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_controllerconfigs-CustomNoUpgrade.crd.yaml


13. machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_controllerconfigs-Default.crd.yaml ⚙️ Configuration changes +1/-1

Update machine config CRD with aws-eusc partition

machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_controllerconfigs-Default.crd.yaml


14. machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_controllerconfigs-DevPreviewNoUpgrade.crd.yaml ⚙️ Configuration changes +1/-1

Update machine config CRD with aws-eusc partition

machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_controllerconfigs-DevPreviewNoUpgrade.crd.yaml


15. machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_controllerconfigs-OKD.crd.yaml ⚙️ Configuration changes +1/-1

Update machine config CRD with aws-eusc partition

machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_controllerconfigs-OKD.crd.yaml


16. machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_controllerconfigs-TechPreviewNoUpgrade.crd.yaml ⚙️ Configuration changes +1/-1

Update machine config CRD with aws-eusc partition

machineconfiguration/v1/zz_generated.crd-manifests/0000_80_machine-config_01_controllerconfigs-TechPreviewNoUpgrade.crd.yaml


17. machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/AAA_ungated.yaml ⚙️ Configuration changes +1/-1

Update feature-gated machine config CRD

machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/AAA_ungated.yaml


18. machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/AWSClusterHostedDNSInstall.yaml ⚙️ Configuration changes +1/-1

Update feature-gated machine config CRD variant

machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/AWSClusterHostedDNSInstall.yaml


19. machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/AWSDualStackInstall.yaml ⚙️ Configuration changes +1/-1

Update feature-gated machine config CRD variant

machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/AWSDualStackInstall.yaml


20. machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/AzureClusterHostedDNSInstall.yaml ⚙️ Configuration changes +1/-1

Update feature-gated machine config CRD variant

machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/AzureClusterHostedDNSInstall.yaml


21. machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/AzureDualStackInstall.yaml ⚙️ Configuration changes +1/-1

Update feature-gated machine config CRD variant

machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/AzureDualStackInstall.yaml


22. machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/DualReplica.yaml ⚙️ Configuration changes +1/-1

Update feature-gated machine config CRD variant

machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/DualReplica.yaml


23. machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/DyanmicServiceEndpointIBMCloud.yaml ⚙️ Configuration changes +1/-1

Update feature-gated machine config CRD variant

machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/DyanmicServiceEndpointIBMCloud.yaml


24. machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/GCPClusterHostedDNSInstall.yaml ⚙️ Configuration changes +1/-1

Update feature-gated machine config CRD variant

machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/GCPClusterHostedDNSInstall.yaml


25. machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/HighlyAvailableArbiter+DualReplica.yaml ⚙️ Configuration changes +1/-1

Update feature-gated machine config CRD variant

machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/HighlyAvailableArbiter+DualReplica.yaml


26. machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/HighlyAvailableArbiter.yaml ⚙️ Configuration changes +1/-1

Update feature-gated machine config CRD variant

machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/HighlyAvailableArbiter.yaml


27. machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/NutanixMultiSubnets.yaml ⚙️ Configuration changes +1/-1

Update feature-gated machine config CRD variant

machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/NutanixMultiSubnets.yaml


28. machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/OnPremDNSRecords.yaml ⚙️ Configuration changes +1/-1

Update feature-gated machine config CRD variant

machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/OnPremDNSRecords.yaml


29. machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/VSphereHostVMGroupZonal.yaml ⚙️ Configuration changes +1/-1

Update feature-gated machine config CRD variant

machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/VSphereHostVMGroupZonal.yaml


30. machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/VSphereMultiNetworks.yaml ⚙️ Configuration changes +1/-1

Update feature-gated machine config CRD variant

machineconfiguration/v1/zz_generated.featuregated-crd-manifests/controllerconfigs.machineconfiguration.openshift.io/VSphereMultiNetworks.yaml


31. payload-manifests/crds/0000_10_config-operator_01_apiservers-CustomNoUpgrade.crd.yaml ⚙️ Configuration changes +4/-3

Update payload CRD manifest for KMS encryption

payload-manifests/crds/0000_10_config-operator_01_apiservers-CustomNoUpgrade.crd.yaml


32. payload-manifests/crds/0000_10_config-operator_01_apiservers-DevPreviewNoUpgrade.crd.yaml ⚙️ Configuration changes +4/-3

Update payload CRD manifest for KMS encryption

payload-manifests/crds/0000_10_config-operator_01_apiservers-DevPreviewNoUpgrade.crd.yaml


33. payload-manifests/crds/0000_10_config-operator_01_dnses.crd.yaml ⚙️ Configuration changes +1/-1

Update payload DNS CRD manifest

payload-manifests/crds/0000_10_config-operator_01_dnses.crd.yaml


34. payload-manifests/crds/0000_80_machine-config_01_controllerconfigs-CustomNoUpgrade.crd.yaml ⚙️ Configuration changes +1/-1

Update payload machine config CRD

payload-manifests/crds/0000_80_machine-config_01_controllerconfigs-CustomNoUpgrade.crd.yaml


35. payload-manifests/crds/0000_80_machine-config_01_controllerconfigs-Default.crd.yaml ⚙️ Configuration changes +1/-1

Update payload machine config CRD

payload-manifests/crds/0000_80_machine-config_01_controllerconfigs-Default.crd.yaml


36. payload-manifests/crds/0000_80_machine-config_01_controllerconfigs-DevPreviewNoUpgrade.crd.yaml ⚙️ Configuration changes +1/-1

Update payload machine config CRD

payload-manifests/crds/0000_80_machine-config_01_controllerconfigs-DevPreviewNoUpgrade.crd.yaml


37. payload-manifests/crds/0000_80_machine-config_01_controllerconfigs-OKD.crd.yaml ⚙️ Configuration changes +1/-1

Update payload machine config CRD

payload-manifests/crds/0000_80_machine-config_01_controllerconfigs-OKD.crd.yaml


38. payload-manifests/crds/0000_80_machine-config_01_controllerconfigs-TechPreviewNoUpgrade.crd.yaml ⚙️ Configuration changes +1/-1

Update payload machine config CRD

payload-manifests/crds/0000_80_machine-config_01_controllerconfigs-TechPreviewNoUpgrade.crd.yaml


Grey Divider

Qodo Logo

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 14, 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 everettraven 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

@tthvo
Copy link
Member Author

tthvo commented Feb 14, 2026

/cc @patrickdillon @rna-afk @liweinan

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 `@config/v1/types_kmsencryption.go`:
- Around line 26-36: Update the XValidation message for keyARN to accurately
describe allowed characters: reference the keyARN field and its
+kubebuilder:validation:XValidation rule and change the message text to state
that the region may contain lowercase letters, digits and hyphens and that the
key ID must be lowercase hexadecimal characters and hyphens; ensure the new
message keeps the format example
`arn:<partition>:kms:<region>:<account_id>:key/<key_id>` and mentions the
account ID must be 12 digits and the region is lowercase letters/digits/hyphens
while the key ID is lowercase hex and hyphens.

Comment on lines 26 to 36
// keyARN specifies the Amazon Resource Name (ARN) of the AWS KMS key used for encryption.
// The value must adhere to the format `arn:aws:kms:<region>:<account_id>:key/<key_id>`, where:
// The value must adhere to the format `arn:<partition>:kms:<region>:<account_id>:key/<key_id>`, where:
// - `<partition>` is the AWS partition (aws, aws-cn, aws-us-gov, or aws-eusc).
// - `<region>` is the AWS region consisting of lowercase letters and hyphens followed by a number.
// - `<account_id>` is a 12-digit numeric identifier for the AWS account.
// - `<key_id>` is a unique identifier for the KMS key, consisting of lowercase hexadecimal characters and hyphens.
//
// +kubebuilder:validation:MaxLength=128
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:XValidation:rule="self.matches('^arn:aws:kms:[a-z0-9-]+:[0-9]{12}:key/[a-f0-9-]+$')",message="keyARN must follow the format `arn:aws:kms:<region>:<account_id>:key/<key_id>`. The account ID must be a 12 digit number and the region and key ID should consist only of lowercase hexadecimal characters and hyphens (-)."
// +kubebuilder:validation:XValidation:rule="self.matches('^arn:(aws|aws-cn|aws-us-gov|aws-eusc):kms:[a-z0-9-]+:[0-9]{12}:key/[a-f0-9-]+$')",message="keyARN must follow the format `arn:<partition>:kms:<region>:<account_id>:key/<key_id>`. The account ID must be a 12 digit number and the region and key ID should consist only of lowercase hexadecimal characters and hyphens (-)."
// +required
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix the keyARN validation message: region isn’t “hexadecimal.”
The regex allows lowercase letters/digits/hyphens for region, so the message should reflect that (and keep hex for key ID).

🛠️ Suggested message tweak
-// +kubebuilder:validation:XValidation:rule="self.matches('^arn:(aws|aws-cn|aws-us-gov|aws-eusc):kms:[a-z0-9-]+:[0-9]{12}:key/[a-f0-9-]+$')",message="keyARN must follow the format `arn:<partition>:kms:<region>:<account_id>:key/<key_id>`. The account ID must be a 12 digit number and the region and key ID should consist only of lowercase hexadecimal characters and hyphens (-)."
+// +kubebuilder:validation:XValidation:rule="self.matches('^arn:(aws|aws-cn|aws-us-gov|aws-eusc):kms:[a-z0-9-]+:[0-9]{12}:key/[a-f0-9-]+$')",message="keyARN must follow the format `arn:<partition>:kms:<region>:<account_id>:key/<key_id>`. The account ID must be a 12 digit number; the region must contain lowercase letters, digits, and hyphens (-); and the key ID must contain lowercase hexadecimal characters and hyphens (-)."
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// keyARN specifies the Amazon Resource Name (ARN) of the AWS KMS key used for encryption.
// The value must adhere to the format `arn:aws:kms:<region>:<account_id>:key/<key_id>`, where:
// The value must adhere to the format `arn:<partition>:kms:<region>:<account_id>:key/<key_id>`, where:
// - `<partition>` is the AWS partition (aws, aws-cn, aws-us-gov, or aws-eusc).
// - `<region>` is the AWS region consisting of lowercase letters and hyphens followed by a number.
// - `<account_id>` is a 12-digit numeric identifier for the AWS account.
// - `<key_id>` is a unique identifier for the KMS key, consisting of lowercase hexadecimal characters and hyphens.
//
// +kubebuilder:validation:MaxLength=128
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:XValidation:rule="self.matches('^arn:aws:kms:[a-z0-9-]+:[0-9]{12}:key/[a-f0-9-]+$')",message="keyARN must follow the format `arn:aws:kms:<region>:<account_id>:key/<key_id>`. The account ID must be a 12 digit number and the region and key ID should consist only of lowercase hexadecimal characters and hyphens (-)."
// +kubebuilder:validation:XValidation:rule="self.matches('^arn:(aws|aws-cn|aws-us-gov|aws-eusc):kms:[a-z0-9-]+:[0-9]{12}:key/[a-f0-9-]+$')",message="keyARN must follow the format `arn:<partition>:kms:<region>:<account_id>:key/<key_id>`. The account ID must be a 12 digit number and the region and key ID should consist only of lowercase hexadecimal characters and hyphens (-)."
// +required
// keyARN specifies the Amazon Resource Name (ARN) of the AWS KMS key used for encryption.
// The value must adhere to the format `arn:<partition>:kms:<region>:<account_id>:key/<key_id>`, where:
// - `<partition>` is the AWS partition (aws, aws-cn, aws-us-gov, or aws-eusc).
// - `<region>` is the AWS region consisting of lowercase letters and hyphens followed by a number.
// - `<account_id>` is a 12-digit numeric identifier for the AWS account.
// - `<key_id>` is a unique identifier for the KMS key, consisting of lowercase hexadecimal characters and hyphens.
//
// +kubebuilder:validation:MaxLength=128
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:XValidation:rule="self.matches('^arn:(aws|aws-cn|aws-us-gov|aws-eusc):kms:[a-z0-9-]+:[0-9]{12}:key/[a-f0-9-]+$')",message="keyARN must follow the format `arn:<partition>:kms:<region>:<account_id>:key/<key_id>`. The account ID must be a 12 digit number; the region must contain lowercase letters, digits, and hyphens (-); and the key ID must contain lowercase hexadecimal characters and hyphens (-)."
// +required
🤖 Prompt for AI Agents
In `@config/v1/types_kmsencryption.go` around lines 26 - 36, Update the
XValidation message for keyARN to accurately describe allowed characters:
reference the keyARN field and its +kubebuilder:validation:XValidation rule and
change the message text to state that the region may contain lowercase letters,
digits and hyphens and that the key ID must be lowercase hexadecimal characters
and hyphens; ensure the new message keeps the format example
`arn:<partition>:kms:<region>:<account_id>:key/<key_id>` and mentions the
account ID must be 12 digits and the region is lowercase letters/digits/hyphens
while the key ID is lowercase hex and hyphens.

@qodo-code-review
Copy link

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (2) 📎 Requirement gaps (0)

Grey Divider


Action required

1. PrivateZoneIAMRole pattern undocumented 📘 Rule violation ✓ Correctness
Description
The PrivateZoneIAMRole field comment does not document the updated kubebuilder Pattern constraint
(including the newly-allowed aws-eusc partition). This violates the requirement that validation
markers and their constraints be described in field comments.
Code

config/v1/types_dns.go[137]

+	// +kubebuilder:validation:Pattern:=`^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$`
Evidence
PR Compliance ID 12 requires that every validation marker’s constraints be documented in the field’s
comment. The PR updates the Pattern to include aws-eusc but does not add corresponding
documentation describing the allowed ARN format/partitions.

AGENTS.md
config/v1/types_dns.go[137-139]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`PrivateZoneIAMRole` has a kubebuilder `Pattern` validation that was modified to include `aws-eusc`, but the field comment does not document the constraint as required.

## Issue Context
Compliance requires that all kubebuilder validation markers and their constraints be documented in the corresponding field comments.

## Fix Focus Areas
- config/v1/types_dns.go[134-140]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. keyARN message mismatches regex 📘 Rule violation ⛯ Reliability
Description
The keyARN validation error message claims the region must be lowercase hexadecimal, but the
validation regex allows broader values; this is misleading and reduces actionable context. Users
will receive incorrect guidance when validation fails.
Code

config/v1/types_kmsencryption.go[35]

+	// +kubebuilder:validation:XValidation:rule="self.matches('^arn:(aws|aws-cn|aws-us-gov|aws-eusc):kms:[a-z0-9-]+:[0-9]{12}:key/[a-f0-9-]+$')",message="keyARN must follow the format `arn:<partition>:kms:<region>:<account_id>:key/<key_id>`. The account ID must be a 12 digit number and the region and key ID should consist only of lowercase hexadecimal characters and hyphens (-)."
Evidence
PR Compliance ID 3 requires error messages to provide meaningful, accurate context about what failed
and why. The updated XValidation message states the region should be lowercase hexadecimal
characters, while the rule permits any [a-z0-9-]+, making the user-facing guidance inaccurate; the
test expectation confirms this message is surfaced.

Rule 3: Generic: Robust Error Handling and Edge Case Management
config/v1/types_kmsencryption.go[35-35]
config/v1/tests/apiservers.config.openshift.io/KMSEncryptionProvider.yaml[176-176]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The `keyARN` validation message is misleading: it says the region must be lowercase hexadecimal characters, but the validation rule allows broader region formats.

## Issue Context
This message is user-facing (as seen in config schema validation tests) and must provide accurate, actionable guidance.

## Fix Focus Areas
- config/v1/types_kmsencryption.go[26-36]
- config/v1/tests/apiservers.config.openshift.io/KMSEncryptionProvider.yaml[173-189]
- config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-CustomNoUpgrade.crd.yaml[177-193]
- config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-DevPreviewNoUpgrade.crd.yaml[177-193]
- config/v1/zz_generated.featuregated-crd-manifests/apiservers.config.openshift.io/KMSEncryptionProvider.yaml[177-193]
- payload-manifests/crds/0000_10_config-operator_01_apiservers-CustomNoUpgrade.crd.yaml[177-193]
- payload-manifests/crds/0000_10_config-operator_01_apiservers-DevPreviewNoUpgrade.crd.yaml[177-193]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Partition support incomplete 🐞 Bug ✓ Correctness
Description
This PR adds aws-eusc support for APIServer KMS keyARN and DNS role ARNs, but AWS CSI driver
kmsKeyARN validation still rejects aws-eusc, creating inconsistent behavior for EUSC clusters. Users
may successfully configure control-plane encryption but be blocked from configuring storage-class
KMS encryption via the CSI driver config CRD validation.
Code

config/v1/types_kmsencryption.go[R27-35]

+	// The value must adhere to the format `arn:<partition>:kms:<region>:<account_id>:key/<key_id>`, where:
+	// - `<partition>` is the AWS partition (aws, aws-cn, aws-us-gov, or aws-eusc).
	// - `<region>` is the AWS region consisting of lowercase letters and hyphens followed by a number.
	// - `<account_id>` is a 12-digit numeric identifier for the AWS account.
	// - `<key_id>` is a unique identifier for the KMS key, consisting of lowercase hexadecimal characters and hyphens.
	//
	// +kubebuilder:validation:MaxLength=128
	// +kubebuilder:validation:MinLength=1
-	// +kubebuilder:validation:XValidation:rule="self.matches('^arn:aws:kms:[a-z0-9-]+:[0-9]{12}:key/[a-f0-9-]+$')",message="keyARN must follow the format `arn:aws:kms:<region>:<account_id>:key/<key_id>`. The account ID must be a 12 digit number and the region and key ID should consist only of lowercase hexadecimal characters and hyphens (-)."
+	// +kubebuilder:validation:XValidation:rule="self.matches('^arn:(aws|aws-cn|aws-us-gov|aws-eusc):kms:[a-z0-9-]+:[0-9]{12}:key/[a-f0-9-]+$')",message="keyARN must follow the format `arn:<partition>:kms:<region>:<account_id>:key/<key_id>`. The account ID must be a 12 digit number and the region and key ID should consist only of lowercase hexadecimal characters and hyphens (-)."
Evidence
The PR expands the APIServer KMS key ARN regex to allow aws-eusc, but the operator API still
restricts kmsKeyARN to a partition allowlist that does not include aws-eusc; the shipped CRD schema
for clustercsidrivers likewise omits aws-eusc. This means EUSC-style ARNs (arn:aws-eusc:...) will
still be rejected for CSI driver KMS configuration even after merging this PR.

config/v1/types_kmsencryption.go[24-47]
operator/v1/types_csi_cluster_driver.go[161-168]
payload-manifests/crds/0000_50_csi-driver_01_clustercsidrivers-Default.crd.yaml[123-129]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
aws-eusc is now allowed for APIServer KMS `keyARN`, but AWS CSI driver `kmsKeyARN` still rejects aws-eusc because its partition allowlist omits it. This creates inconsistent AWS partition support across APIs on EUSC clusters.

### Issue Context
EUSC ARNs start with `arn:aws-eusc:`. After this PR, APIServer KMS config will accept that partition, but `clustercsidrivers.operator.openshift.io` schema validation will still reject it for `spec.driverConfig.aws.kmsKeyARN`.

### Fix Focus Areas
- operator/v1/types_csi_cluster_driver.go[161-168]
- operator/v1/zz_generated.crd-manifests/0000_50_csi-driver_01_clustercsidrivers-Default.crd.yaml[120-130]
- payload-manifests/crds/0000_50_csi-driver_01_clustercsidrivers-Default.crd.yaml[120-130]
- operator/v1/zz_generated.featuregated-crd-manifests/clustercsidrivers.operator.openshift.io/AAA_ungated.yaml[100-112]

### Notes
After updating the kubebuilder Pattern, re-run generators so all generated CRDs/manifests stay in sync.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

// operations on the cluster's private hosted zone specified in the cluster DNS config.
// When left empty, no role should be assumed.
// +kubebuilder:validation:Pattern:=`^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$`
// +kubebuilder:validation:Pattern:=`^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$`

Choose a reason for hiding this comment

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

Action required

1. privatezoneiamrole pattern undocumented 📘 Rule violation ✓ Correctness

The PrivateZoneIAMRole field comment does not document the updated kubebuilder Pattern constraint
(including the newly-allowed aws-eusc partition). This violates the requirement that validation
markers and their constraints be described in field comments.
Agent Prompt
## Issue description
`PrivateZoneIAMRole` has a kubebuilder `Pattern` validation that was modified to include `aws-eusc`, but the field comment does not document the constraint as required.

## Issue Context
Compliance requires that all kubebuilder validation markers and their constraints be documented in the corresponding field comments.

## Fix Focus Areas
- config/v1/types_dns.go[134-140]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

// +kubebuilder:validation:MaxLength=128
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:XValidation:rule="self.matches('^arn:aws:kms:[a-z0-9-]+:[0-9]{12}:key/[a-f0-9-]+$')",message="keyARN must follow the format `arn:aws:kms:<region>:<account_id>:key/<key_id>`. The account ID must be a 12 digit number and the region and key ID should consist only of lowercase hexadecimal characters and hyphens (-)."
// +kubebuilder:validation:XValidation:rule="self.matches('^arn:(aws|aws-cn|aws-us-gov|aws-eusc):kms:[a-z0-9-]+:[0-9]{12}:key/[a-f0-9-]+$')",message="keyARN must follow the format `arn:<partition>:kms:<region>:<account_id>:key/<key_id>`. The account ID must be a 12 digit number and the region and key ID should consist only of lowercase hexadecimal characters and hyphens (-)."

Choose a reason for hiding this comment

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

Action required

2. keyarn message mismatches regex 📘 Rule violation ⛯ Reliability

The keyARN validation error message claims the region must be lowercase hexadecimal, but the
validation regex allows broader values; this is misleading and reduces actionable context. Users
will receive incorrect guidance when validation fails.
Agent Prompt
## Issue description
The `keyARN` validation message is misleading: it says the region must be lowercase hexadecimal characters, but the validation rule allows broader region formats.

## Issue Context
This message is user-facing (as seen in config schema validation tests) and must provide accurate, actionable guidance.

## Fix Focus Areas
- config/v1/types_kmsencryption.go[26-36]
- config/v1/tests/apiservers.config.openshift.io/KMSEncryptionProvider.yaml[173-189]
- config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-CustomNoUpgrade.crd.yaml[177-193]
- config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_apiservers-DevPreviewNoUpgrade.crd.yaml[177-193]
- config/v1/zz_generated.featuregated-crd-manifests/apiservers.config.openshift.io/KMSEncryptionProvider.yaml[177-193]
- payload-manifests/crds/0000_10_config-operator_01_apiservers-CustomNoUpgrade.crd.yaml[177-193]
- payload-manifests/crds/0000_10_config-operator_01_apiservers-DevPreviewNoUpgrade.crd.yaml[177-193]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +27 to +35
// The value must adhere to the format `arn:<partition>:kms:<region>:<account_id>:key/<key_id>`, where:
// - `<partition>` is the AWS partition (aws, aws-cn, aws-us-gov, or aws-eusc).
// - `<region>` is the AWS region consisting of lowercase letters and hyphens followed by a number.
// - `<account_id>` is a 12-digit numeric identifier for the AWS account.
// - `<key_id>` is a unique identifier for the KMS key, consisting of lowercase hexadecimal characters and hyphens.
//
// +kubebuilder:validation:MaxLength=128
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:XValidation:rule="self.matches('^arn:aws:kms:[a-z0-9-]+:[0-9]{12}:key/[a-f0-9-]+$')",message="keyARN must follow the format `arn:aws:kms:<region>:<account_id>:key/<key_id>`. The account ID must be a 12 digit number and the region and key ID should consist only of lowercase hexadecimal characters and hyphens (-)."
// +kubebuilder:validation:XValidation:rule="self.matches('^arn:(aws|aws-cn|aws-us-gov|aws-eusc):kms:[a-z0-9-]+:[0-9]{12}:key/[a-f0-9-]+$')",message="keyARN must follow the format `arn:<partition>:kms:<region>:<account_id>:key/<key_id>`. The account ID must be a 12 digit number and the region and key ID should consist only of lowercase hexadecimal characters and hyphens (-)."

Choose a reason for hiding this comment

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

Action required

3. Partition support incomplete 🐞 Bug ✓ Correctness

This PR adds aws-eusc support for APIServer KMS keyARN and DNS role ARNs, but AWS CSI driver
kmsKeyARN validation still rejects aws-eusc, creating inconsistent behavior for EUSC clusters. Users
may successfully configure control-plane encryption but be blocked from configuring storage-class
KMS encryption via the CSI driver config CRD validation.
Agent Prompt
### Issue description
aws-eusc is now allowed for APIServer KMS `keyARN`, but AWS CSI driver `kmsKeyARN` still rejects aws-eusc because its partition allowlist omits it. This creates inconsistent AWS partition support across APIs on EUSC clusters.

### Issue Context
EUSC ARNs start with `arn:aws-eusc:`. After this PR, APIServer KMS config will accept that partition, but `clustercsidrivers.operator.openshift.io` schema validation will still reject it for `spec.driverConfig.aws.kmsKeyARN`.

### Fix Focus Areas
- operator/v1/types_csi_cluster_driver.go[161-168]
- operator/v1/zz_generated.crd-manifests/0000_50_csi-driver_01_clustercsidrivers-Default.crd.yaml[120-130]
- payload-manifests/crds/0000_50_csi-driver_01_clustercsidrivers-Default.crd.yaml[120-130]
- operator/v1/zz_generated.featuregated-crd-manifests/clustercsidrivers.operator.openshift.io/AAA_ungated.yaml[100-112]

### Notes
After updating the kubebuilder Pattern, re-run generators so all generated CRDs/manifests stay in sync.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 14, 2026

@tthvo: all tests passed!

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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants