Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 52 additions & 1 deletion config/v1/tests/dnses.config.openshift.io/AAA_ungated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,57 @@ tests:
type: AWS
aws:
privateZoneIAMRole: arn:aws:iam::123456789012:role/foo
- name: Should be able to specify an AWS China role ARN for a private hosted zone
initial: |
apiVersion: config.openshift.io/v1
kind: DNS
spec:
platform:
type: AWS
aws:
privateZoneIAMRole: arn:aws-cn:iam::123456789012:role/foo
expected: |
apiVersion: config.openshift.io/v1
kind: DNS
spec:
platform:
type: AWS
aws:
privateZoneIAMRole: arn:aws-cn:iam::123456789012:role/foo
- name: Should be able to specify an AWS GovCloud role ARN for a private hosted zone
initial: |
apiVersion: config.openshift.io/v1
kind: DNS
spec:
platform:
type: AWS
aws:
privateZoneIAMRole: arn:aws-us-gov:iam::123456789012:role/foo
expected: |
apiVersion: config.openshift.io/v1
kind: DNS
spec:
platform:
type: AWS
aws:
privateZoneIAMRole: arn:aws-us-gov:iam::123456789012:role/foo
- name: Should be able to specify an AWS EUSC role ARN for a private hosted zone
initial: |
apiVersion: config.openshift.io/v1
kind: DNS
spec:
platform:
type: AWS
aws:
privateZoneIAMRole: arn:aws-eusc:iam::123456789012:role/foo
expected: |
apiVersion: config.openshift.io/v1
kind: DNS
spec:
platform:
type: AWS
aws:
privateZoneIAMRole: arn:aws-eusc:iam::123456789012:role/foo
- name: Should not be able to specify unsupported platform
initial: |
apiVersion: config.openshift.io/v1
Expand All @@ -50,7 +101,7 @@ tests:
type: AWS
aws:
privateZoneIAMRole: arn:aws:iam:bad:123456789012:role/foo
expectedError: "DNS.config.openshift.io \"cluster\" is invalid: spec.platform.aws.privateZoneIAMRole: Invalid value: \"arn:aws:iam:bad:123456789012:role/foo\": spec.platform.aws.privateZoneIAMRole in body should match '^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\\/.*$'"
expectedError: "DNS.config.openshift.io \"cluster\" is invalid: spec.platform.aws.privateZoneIAMRole: Invalid value: \"arn:aws:iam:bad:123456789012:role/foo\": spec.platform.aws.privateZoneIAMRole in body should match '^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\\/.*$'"
- name: Should not be able to specify different type and platform
initial: |
apiVersion: config.openshift.io/v1
Expand Down
5 changes: 4 additions & 1 deletion config/v1/types_dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ type AWSDNSSpec struct {
// 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.
// +kubebuilder:validation:Pattern:=`^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$`
// The ARN must follow the format: arn:<partition>:iam::<account-id>:role/<role-name>
// where <partition> is one of "aws", "aws-cn", "aws-us-gov", or "aws-eusc",
// and <account-id> is a 12-digit AWS account number.
// +kubebuilder:validation:Pattern:=`^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$`
// +optional
PrivateZoneIAMRole string `json:"privateZoneIAMRole"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ spec:
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.
pattern: ^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$
The ARN must follow the format: arn:<partition>:iam::<account-id>:role/<role-name>
where <partition> is one of "aws", "aws-cn", "aws-us-gov", or "aws-eusc",
and <account-id> is a 12-digit AWS account number.
pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$
type: string
type: object
type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ spec:
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.
pattern: ^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$
The ARN must follow the format: arn:<partition>:iam::<account-id>:role/<role-name>
where <partition> is one of "aws", "aws-cn", "aws-us-gov", or "aws-eusc",
and <account-id> is a 12-digit AWS account number.
pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$
type: string
type: object
type:
Expand Down
2 changes: 1 addition & 1 deletion config/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ spec:
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.
pattern: ^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$
The ARN must follow the format: arn:<partition>:iam::<account-id>:role/<role-name>
where <partition> is one of "aws", "aws-cn", "aws-us-gov", or "aws-eusc",
and <account-id> is a 12-digit AWS account number.
pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$
type: string
type: object
type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ spec:
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.
pattern: ^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$
The ARN must follow the format: arn:<partition>:iam::<account-id>:role/<role-name>
where <partition> is one of "aws", "aws-cn", "aws-us-gov", or "aws-eusc",
and <account-id> is a 12-digit AWS account number.
pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$
type: string
type: object
type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ spec:
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.
pattern: ^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$
The ARN must follow the format: arn:<partition>:iam::<account-id>:role/<role-name>
where <partition> is one of "aws", "aws-cn", "aws-us-gov", or "aws-eusc",
and <account-id> is a 12-digit AWS account number.
pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$
type: string
type: object
type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ spec:
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.
pattern: ^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$
The ARN must follow the format: arn:<partition>:iam::<account-id>:role/<role-name>
where <partition> is one of "aws", "aws-cn", "aws-us-gov", or "aws-eusc",
and <account-id> is a 12-digit AWS account number.
pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$
type: string
type: object
type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ spec:
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.
pattern: ^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$
The ARN must follow the format: arn:<partition>:iam::<account-id>:role/<role-name>
where <partition> is one of "aws", "aws-cn", "aws-us-gov", or "aws-eusc",
and <account-id> is a 12-digit AWS account number.
pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$
type: string
type: object
type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ spec:
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.
pattern: ^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$
The ARN must follow the format: arn:<partition>:iam::<account-id>:role/<role-name>
where <partition> is one of "aws", "aws-cn", "aws-us-gov", or "aws-eusc",
and <account-id> is a 12-digit AWS account number.
pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$
type: string
type: object
type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ spec:
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.
pattern: ^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$
The ARN must follow the format: arn:<partition>:iam::<account-id>:role/<role-name>
where <partition> is one of "aws", "aws-cn", "aws-us-gov", or "aws-eusc",
and <account-id> is a 12-digit AWS account number.
pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$
type: string
type: object
type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ spec:
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.
pattern: ^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$
The ARN must follow the format: arn:<partition>:iam::<account-id>:role/<role-name>
where <partition> is one of "aws", "aws-cn", "aws-us-gov", or "aws-eusc",
and <account-id> is a 12-digit AWS account number.
pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$
type: string
type: object
type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ spec:
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.
pattern: ^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$
The ARN must follow the format: arn:<partition>:iam::<account-id>:role/<role-name>
where <partition> is one of "aws", "aws-cn", "aws-us-gov", or "aws-eusc",
and <account-id> is a 12-digit AWS account number.
pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$
type: string
type: object
type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ spec:
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.
pattern: ^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$
The ARN must follow the format: arn:<partition>:iam::<account-id>:role/<role-name>
where <partition> is one of "aws", "aws-cn", "aws-us-gov", or "aws-eusc",
and <account-id> is a 12-digit AWS account number.
pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$
type: string
type: object
type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ spec:
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.
pattern: ^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$
The ARN must follow the format: arn:<partition>:iam::<account-id>:role/<role-name>
where <partition> is one of "aws", "aws-cn", "aws-us-gov", or "aws-eusc",
and <account-id> is a 12-digit AWS account number.
pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$
type: string
type: object
type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ spec:
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.
pattern: ^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$
The ARN must follow the format: arn:<partition>:iam::<account-id>:role/<role-name>
where <partition> is one of "aws", "aws-cn", "aws-us-gov", or "aws-eusc",
and <account-id> is a 12-digit AWS account number.
pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$
type: string
type: object
type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ spec:
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.
pattern: ^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$
The ARN must follow the format: arn:<partition>:iam::<account-id>:role/<role-name>
where <partition> is one of "aws", "aws-cn", "aws-us-gov", or "aws-eusc",
and <account-id> is a 12-digit AWS account number.
pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$
type: string
type: object
type:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ spec:
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.
pattern: ^arn:(aws|aws-cn|aws-us-gov):iam::[0-9]{12}:role\/.*$
The ARN must follow the format: arn:<partition>:iam::<account-id>:role/<role-name>
where <partition> is one of "aws", "aws-cn", "aws-us-gov", or "aws-eusc",
and <account-id> is a 12-digit AWS account number.
pattern: ^arn:(aws|aws-cn|aws-us-gov|aws-eusc):iam::[0-9]{12}:role\/.*$
type: string
type: object
type:
Expand Down
Loading