DNS: Add awsPrivateHostedZoneRole#1460
DNS: Add awsPrivateHostedZoneRole#1460openshift-merge-robot merged 1 commit intoopenshift:masterfrom
Conversation
|
Hello @patrickdillon! Some important instructions when contributing to openshift/api: |
|
We are still deciding between whether this should live in cluster infrastructure or dns. Currently this only has the DNS implementation, which I believe is preferred. If it's helpful, I can also add the infrastructure implementation in a separate commit. Please LMK if that would be helpful and I can add it. |
c28314e to
7c74afe
Compare
|
@deads2k ptal. |
7c74afe to
0345ef8
Compare
deads2k
left a comment
There was a problem hiding this comment.
a few additional changes please.
config/v1/types_dns.go
Outdated
| // +kubebuilder:validation:XValidation:rule="has(self.platform) && self.platform == 'AWS' ? has(self.aws) : !has(self.aws)",message="aws configuration is required when platform is AWS, and forbidden otherwise" | ||
| type DNSPlatformSpec struct { | ||
| // type is the underlying infrastructure provider for the cluster. | ||
| // Allowed values: "AWS". |
There was a problem hiding this comment.
Empty needs to be allowed to handle upgrade cases.
There was a problem hiding this comment.
I have handled this in the code, but we couldn't figure out a test case (which you mentioned in slack). None of the fields in this config are mutable (although I'm not certain that is enforced).
Was trying a test like this:
onUpdate:
- name: Should allow empty platform on upgrade
initial: |
apiVersion: config.openshift.io/v1
kind: DNS
spec:
zone:
id: foo
updated: |
apiVersion: config.openshift.io/v1
kind: DNS
spec:
zone:
id: bar
expected: |
apiVersion: config.openshift.io/v1
kind: DNS
spec:
zone:
id: bar
platform:
type: ""But that is failing
[FAILED] the following fields were expected to match but did not:
[(spec.platform/spec.platform) (spec.zone/spec.zone)]
We're not really sure how to write the upgrade test
|
@ingvagabund and @deads2k thanks for the review. I have addressed the feedback (except I still need to add the integration tests), but have a few resulting questions. Thanks! |
731d048 to
b68af6b
Compare
b68af6b to
55be8ed
Compare
|
@ingvagabund @deads2k I think all feedback has been addressed (except one question about tests) |
55be8ed to
597c4d9
Compare
|
/approve |
| - name: Should not be able to specify different type and platform | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: | ||
| platform: | ||
| type: "" | ||
| aws: | ||
| privateZoneIAMRole: arn:aws:iam:123456789012:role/foo | ||
| expectedError: "Invalid value: \"object\": aws configuration is required when platform is AWS, and forbidden otherwise" | ||
| - name: Should not be able to specify different type and platform | ||
| initial: | | ||
| apiVersion: config.openshift.io/v1 | ||
| kind: DNS | ||
| spec: | ||
| platform: | ||
| type: "" | ||
| aws: | ||
| privateZoneIAMRole: arn:aws:iam:123456789012:role/foo | ||
| expectedError: "Invalid value: \"object\": aws configuration is required when platform is AWS, and forbidden otherwise" |
There was a problem hiding this comment.
You have the same test case twice.
| enum: | ||
| - "" | ||
| - AWS | ||
| - Azure | ||
| - BareMetal | ||
| - GCP | ||
| - Libvirt | ||
| - OpenStack | ||
| - None | ||
| - VSphere | ||
| - oVirt | ||
| - IBMCloud | ||
| - KubeVirt | ||
| - EquinixMetal | ||
| - PowerVS | ||
| - AlibabaCloud | ||
| - Nutanix | ||
| - External |
There was a problem hiding this comment.
Is this going to cause confusing error messages, or does the x-kubernetes-validations rule take precedence and prevent the enum rule from causing unsupported values to be printed in error messages?
There was a problem hiding this comment.
In the test, the x-kubernetes-validations message takes precedence, so I think we're ok.
597c4d9 to
c49c061
Compare
Adds a field to the DNS config to hold a role to assume when performing cross- account installs in an AWS shared VPC environment. Co-authored-by: Grant Spence <gcs278@vt.edu> Co-authored-by: deads2k
c49c061 to
815017c
Compare
|
@patrickdillon: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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/test-infra repository. I understand the commands that are listed here. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, Miciah, patrickdillon The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Adds a field to the DNS config to hold a role to assume when performing cross- account installs in an AWS shared VPC
environment.
openshift/enhancements#1397