-
Notifications
You must be signed in to change notification settings - Fork 597
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
Open
tthvo
wants to merge
1
commit into
openshift:master
Choose a base branch
from
tthvo:CORS-4337
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+5,365
−42
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
config/v1/tests/dnses.config.openshift.io/AWSEuropeanSovereignCloudInstall.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this | ||
| name: "DNS" | ||
| crdName: dnses.config.openshift.io | ||
| featureGates: | ||
| - AWSEuropeanSovereignCloudInstall | ||
| tests: | ||
| onCreate: | ||
| - name: Should be able to create a minimal DNS | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: {} # No spec is required for a DNS | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: {} | ||
| - name: Should be able to specify an AWS Europe Sovereign Cloud IAM role ARN for privateZoneIAMRole | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: | ||
| platform: | ||
| type: AWS | ||
| aws: | ||
| privateZoneIAMRole: arn:aws-eusc:iam::123456789012:role/my-role | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: | ||
| platform: | ||
| type: AWS | ||
| aws: | ||
| privateZoneIAMRole: arn:aws-eusc:iam::123456789012:role/my-role | ||
| - name: Should not be able to specify invalid privateZoneIAMRole ARN | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| metadata: | ||
| name: cluster | ||
| spec: | ||
| platform: | ||
| type: AWS | ||
| aws: | ||
| privateZoneIAMRole: arn:invalid-partition:iam::123456789012:role/my-role | ||
| expectedError: "DNS.config.openshift.io \"cluster\" is invalid: spec.platform.aws.privateZoneIAMRole: Invalid value: \"arn:invalid-partition:iam::123456789012:role/my-role\": IAM role ARN must match \"^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\\/.*$\"" | ||
| onUpdate: | ||
| - name: Can switch from empty (default), to AWS with aws-eusc IAM role ARN | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: | ||
| platform: | ||
| type: "" | ||
| updated: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: | ||
| platform: | ||
| type: AWS | ||
| aws: | ||
| privateZoneIAMRole: arn:aws-eusc:iam::123456789012:role/my-role | ||
| expected: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: | ||
| platform: | ||
| type: AWS | ||
| aws: | ||
| privateZoneIAMRole: arn:aws-eusc:iam::123456789012:role/my-role |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
194 changes: 194 additions & 0 deletions
194
...g/v1/zz_generated.crd-manifests/0000_10_config-operator_01_dnses-CustomNoUpgrade.crd.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,194 @@ | ||
| apiVersion: apiextensions.k8s.io/v1 | ||
| kind: CustomResourceDefinition | ||
| metadata: | ||
| annotations: | ||
| api-approved.openshift.io: https://github.com/openshift/api/pull/470 | ||
| api.openshift.io/merged-by-featuregates: "true" | ||
| include.release.openshift.io/ibm-cloud-managed: "true" | ||
| include.release.openshift.io/self-managed-high-availability: "true" | ||
| release.openshift.io/bootstrap-required: "true" | ||
| release.openshift.io/feature-set: CustomNoUpgrade | ||
| name: dnses.config.openshift.io | ||
| spec: | ||
| group: config.openshift.io | ||
| names: | ||
| kind: DNS | ||
| listKind: DNSList | ||
| plural: dnses | ||
| singular: dns | ||
| scope: Cluster | ||
| versions: | ||
| - name: v1 | ||
| schema: | ||
| openAPIV3Schema: | ||
| description: |- | ||
| DNS holds cluster-wide information about DNS. The canonical name is `cluster` | ||
|
|
||
| Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). | ||
| properties: | ||
| apiVersion: | ||
| description: |- | ||
| APIVersion defines the versioned schema of this representation of an object. | ||
| Servers should convert recognized schemas to the latest internal value, and | ||
| may reject unrecognized values. | ||
| More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | ||
| type: string | ||
| kind: | ||
| description: |- | ||
| Kind is a string value representing the REST resource this object represents. | ||
| Servers may infer this from the endpoint the client submits requests to. | ||
| Cannot be updated. | ||
| In CamelCase. | ||
| More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | ||
| type: string | ||
| metadata: | ||
| type: object | ||
| spec: | ||
| description: spec holds user settable values for configuration | ||
| properties: | ||
| baseDomain: | ||
| description: |- | ||
| baseDomain is the base domain of the cluster. All managed DNS records will | ||
| be sub-domains of this base. | ||
|
|
||
| For example, given the base domain `openshift.example.com`, an API server | ||
| DNS record may be created for `cluster-api.openshift.example.com`. | ||
|
|
||
| Once set, this field cannot be changed. | ||
| type: string | ||
| platform: | ||
| description: |- | ||
| platform holds configuration specific to the underlying | ||
| infrastructure provider for DNS. | ||
| When omitted, this means the user has no opinion and the platform is left | ||
| to choose reasonable defaults. These defaults are subject to change over time. | ||
| properties: | ||
| aws: | ||
| description: aws contains DNS configuration specific to the Amazon | ||
| Web Services cloud provider. | ||
| properties: | ||
| privateZoneIAMRole: | ||
| description: |- | ||
| privateZoneIAMRole contains the ARN of an IAM role that should be assumed when performing | ||
| operations on the cluster's private hosted zone specified in the cluster DNS config. | ||
| When left empty, no role should be assumed. | ||
| type: string | ||
| x-kubernetes-validations: | ||
| - message: IAM role ARN must match "^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$" | ||
| rule: matches(self, '^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$') | ||
| - message: IAM role ARN must match "^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$" | ||
| rule: matches(self, '^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$') | ||
| type: object | ||
| type: | ||
| description: |- | ||
| type is the underlying infrastructure provider for the cluster. | ||
| Allowed values: "", "AWS". | ||
|
|
||
| Individual components may not support all platforms, | ||
| and must handle unrecognized platforms with best-effort defaults. | ||
| enum: | ||
| - "" | ||
| - AWS | ||
| - Azure | ||
| - BareMetal | ||
| - GCP | ||
| - Libvirt | ||
| - OpenStack | ||
| - None | ||
| - VSphere | ||
| - oVirt | ||
| - IBMCloud | ||
| - KubeVirt | ||
| - EquinixMetal | ||
| - PowerVS | ||
| - AlibabaCloud | ||
| - Nutanix | ||
| - External | ||
| type: string | ||
| x-kubernetes-validations: | ||
| - message: allowed values are '' and 'AWS' | ||
| rule: self in ['','AWS'] | ||
| required: | ||
| - type | ||
| type: object | ||
| x-kubernetes-validations: | ||
| - message: aws configuration is required when platform is AWS, and | ||
| forbidden otherwise | ||
| rule: 'has(self.type) && self.type == ''AWS'' ? has(self.aws) : | ||
| !has(self.aws)' | ||
| privateZone: | ||
| description: |- | ||
| privateZone is the location where all the DNS records that are only available internally | ||
| to the cluster exist. | ||
|
|
||
| If this field is nil, no private records should be created. | ||
|
|
||
| Once set, this field cannot be changed. | ||
| properties: | ||
| id: | ||
| description: |- | ||
| id is the identifier that can be used to find the DNS hosted zone. | ||
|
|
||
| on AWS zone can be fetched using `ID` as id in [1] | ||
| on Azure zone can be fetched using `ID` as a pre-determined name in [2], | ||
| on GCP zone can be fetched using `ID` as a pre-determined name in [3]. | ||
|
|
||
| [1]: https://docs.aws.amazon.com/cli/latest/reference/route53/get-hosted-zone.html#options | ||
| [2]: https://docs.microsoft.com/en-us/cli/azure/network/dns/zone?view=azure-cli-latest#az-network-dns-zone-show | ||
| [3]: https://cloud.google.com/dns/docs/reference/v1/managedZones/get | ||
| type: string | ||
| tags: | ||
| additionalProperties: | ||
| type: string | ||
| description: |- | ||
| tags can be used to query the DNS hosted zone. | ||
|
|
||
| on AWS, resourcegroupstaggingapi [1] can be used to fetch a zone using `Tags` as tag-filters, | ||
|
|
||
| [1]: https://docs.aws.amazon.com/cli/latest/reference/resourcegroupstaggingapi/get-resources.html#options | ||
| type: object | ||
| type: object | ||
| publicZone: | ||
| description: |- | ||
| publicZone is the location where all the DNS records that are publicly accessible to | ||
| the internet exist. | ||
|
|
||
| If this field is nil, no public records should be created. | ||
|
|
||
| Once set, this field cannot be changed. | ||
| properties: | ||
| id: | ||
| description: |- | ||
| id is the identifier that can be used to find the DNS hosted zone. | ||
|
|
||
| on AWS zone can be fetched using `ID` as id in [1] | ||
| on Azure zone can be fetched using `ID` as a pre-determined name in [2], | ||
| on GCP zone can be fetched using `ID` as a pre-determined name in [3]. | ||
|
|
||
| [1]: https://docs.aws.amazon.com/cli/latest/reference/route53/get-hosted-zone.html#options | ||
| [2]: https://docs.microsoft.com/en-us/cli/azure/network/dns/zone?view=azure-cli-latest#az-network-dns-zone-show | ||
| [3]: https://cloud.google.com/dns/docs/reference/v1/managedZones/get | ||
| type: string | ||
| tags: | ||
| additionalProperties: | ||
| type: string | ||
| description: |- | ||
| tags can be used to query the DNS hosted zone. | ||
|
|
||
| on AWS, resourcegroupstaggingapi [1] can be used to fetch a zone using `Tags` as tag-filters, | ||
|
|
||
| [1]: https://docs.aws.amazon.com/cli/latest/reference/resourcegroupstaggingapi/get-resources.html#options | ||
| type: object | ||
| type: object | ||
| type: object | ||
| status: | ||
| description: status holds observed values from the cluster. They may not | ||
| be overridden. | ||
| type: object | ||
| required: | ||
| - spec | ||
| type: object | ||
| served: true | ||
| storage: true | ||
| subresources: | ||
| status: {} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: openshift/api
Length of output: 104
🏁 Script executed:
Repository: openshift/api
Length of output: 2135
🏁 Script executed:
Repository: openshift/api
Length of output: 1386
🏁 Script executed:
Repository: openshift/api
Length of output: 40908
🏁 Script executed:
Repository: openshift/api
Length of output: 784
🏁 Script executed:
Repository: openshift/api
Length of output: 933
🏁 Script executed:
Repository: openshift/api
Length of output: 3854
🏁 Script executed:
Repository: openshift/api
Length of output: 4003
🏁 Script executed:
Repository: openshift/api
Length of output: 5789
🏁 Script executed:
Repository: openshift/api
Length of output: 39
🏁 Script executed:
Repository: openshift/api
Length of output: 39
🏁 Script executed:
Repository: openshift/api
Length of output: 39
🏁 Script executed:
Repository: openshift/api
Length of output: 2497
🏁 Script executed:
Repository: openshift/api
Length of output: 39
🏁 Script executed:
# Check the complete patch_validation.go file structure wc -l tools/vendor/sigs.k8s.io/controller-tools/pkg/crd/markers/patch_validation.goRepository: openshift/api
Length of output: 138
🏁 Script executed:
# Read the entire patch_validation.go file to understand the full logic cat tools/vendor/sigs.k8s.io/controller-tools/pkg/crd/markers/patch_validation.goRepository: openshift/api
Length of output: 9963
🏁 Script executed:
Repository: openshift/api
Length of output: 8081
🏁 Script executed:
Repository: openshift/api
Length of output: 39
🏁 Script executed:
Repository: openshift/api
Length of output: 788
🏁 Script executed:
Repository: openshift/api
Length of output: 754
🏁 Script executed:
Repository: openshift/api
Length of output: 248
🏁 Script executed:
Repository: openshift/api
Length of output: 1681
🏁 Script executed:
Repository: openshift/api
Length of output: 1262
🏁 Script executed:
Repository: openshift/api
Length of output: 2736
🏁 Script executed:
Repository: openshift/api
Length of output: 225
The feature-gated DNS validator rules are both present in gate-enabled variants, not replaced.
Lines 137–138 both append validation rules to the same field. When the
AWSEuropeanSovereignCloudInstallgate is enabled, both the base rule (rejectingaws-eusc) and the gate-enabled rule (acceptingaws-eusc) are appended. Since all x-kubernetes-validations rules must pass, the base rule's rejection ofaws-eusctakes precedence, making the gate ineffective. The architecture only supports additive validators; the gate-enabled rule must replace the base rule instead of coexisting with it.🤖 Prompt for AI Agents