-
Notifications
You must be signed in to change notification settings - Fork 591
CORS-4337: allow AWS Europe Sovereign Cloud partition #2708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -24,14 +24,15 @@ type KMSConfig struct { | |||||||||||||||||||||||||||||||||||||||||||||||||
| // AWSKMSConfig defines the KMS config specific to AWS KMS provider | ||||||||||||||||||||||||||||||||||||||||||||||||||
| type AWSKMSConfig struct { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| // 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 (-)." | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. keyarn message mismatches regex 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
Comment on lines
+27
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 3. Partition support incomplete 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
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| // +required | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
26
to
36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the keyARN validation message: region isn’t “hexadecimal.” 🛠️ 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
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||
| KeyARN string `json:"keyARN"` | ||||||||||||||||||||||||||||||||||||||||||||||||||
| // region specifies the AWS region where the KMS instance exists, and follows the format | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. privatezoneiamrole pattern undocumented
📘 Rule violation✓ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools