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
57 changes: 57 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,60 @@ 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 be able to set domain initially when empty
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec: {}
updated: |
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
- 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
2 changes: 2 additions & 0 deletions config/v1/types_ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ type IngressSpec struct {
// default ingresscontroller domain will follow this pattern: "*.<domain>".
//
// Once set, changing domain is not currently supported.
// +kubebuilder:validation:XValidation:rule="oldSelf == '' || self == oldSelf",message="domain is immutable once set"
// +optional
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: oldSelf == '' || 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: oldSelf == '' || self == oldSelf
loadBalancer:
description: |-
loadBalancer contains the load balancer details in general which are not only specific to the underlying infrastructure
Expand Down
1 change: 0 additions & 1 deletion openapi/generated_openapi/zz_generated.openapi.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 @@ -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: oldSelf == '' || self == oldSelf
loadBalancer:
description: |-
loadBalancer contains the load balancer details in general which are not only specific to the underlying infrastructure
Expand Down