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
42 changes: 42 additions & 0 deletions config/v1/tests/ingresses.config.openshift.io/AAA_ungated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,45 @@ tests:
apiVersion: config.openshift.io/v1
kind: Ingress
spec: {}
- name: Should be able to create an Ingress with domain set
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
expected: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
onUpdate:
- name: Should not be able to change domain once set
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
updated: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: test.example.com
expectedError: "domain is immutable once set"
- name: Should be able to update other fields without changing domain
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
updated: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
appsDomain: custom.example.com
expected: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
appsDomain: custom.example.com
1 change: 1 addition & 0 deletions config/v1/types_ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type IngressSpec struct {
// default ingresscontroller domain will follow this pattern: "*.<domain>".
//
// Once set, changing domain is not currently supported.
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="domain is immutable once set"
Domain string `json:"domain"`

// appsDomain is an optional domain to use instead of the one specified
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ spec:

Once set, changing domain is not currently supported.
type: string
x-kubernetes-validations:
- message: domain is immutable once set
rule: self == oldSelf
loadBalancer:
description: |-
loadBalancer contains the load balancer details in general which are not only specific to the underlying infrastructure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ spec:
Once set, changing domain is not currently supported.
type: string
x-kubernetes-validations:
- message: domain is immutable once set
rule: self == oldSelf
loadBalancer:
description: |-
loadBalancer contains the load balancer details in general which are not only specific to the underlying infrastructure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ spec:

Once set, changing domain is not currently supported.
type: string
x-kubernetes-validations:
- message: domain is immutable once set
rule: self == oldSelf
loadBalancer:
description: |-
loadBalancer contains the load balancer details in general which are not only specific to the underlying infrastructure
Expand Down