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
117 changes: 117 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,120 @@ tests:
apiVersion: config.openshift.io/v1
kind: Ingress
spec: {}
- name: Should be able to create an Ingress with Classic load balancer type and IPv4 ipFamily
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
loadBalancer:
platform:
type: AWS
aws:
type: Classic
ipFamily: IPv4
expected: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
loadBalancer:
platform:
type: AWS
aws:
type: Classic
ipFamily: IPv4
- name: Should be able to create an Ingress with Classic load balancer type and omitted ipFamily
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
loadBalancer:
platform:
type: AWS
aws:
type: Classic
expected: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
loadBalancer:
platform:
type: AWS
aws:
type: Classic
ipFamily: IPv4
- name: Should not be able to create an Ingress with Classic load balancer type and DualStackIPv4Primary ipFamily
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
loadBalancer:
platform:
type: AWS
aws:
type: Classic
ipFamily: DualStackIPv4Primary
expectedError: "spec.loadBalancer.platform.aws: Invalid value: \"object\": when type is Classic, ipFamily must be IPv4 or omitted (defaults to IPv4)"
- name: Should not be able to create an Ingress with Classic load balancer type and DualStackIPv6Primary ipFamily
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
loadBalancer:
platform:
type: AWS
aws:
type: Classic
ipFamily: DualStackIPv6Primary
expectedError: "spec.loadBalancer.platform.aws: Invalid value: \"object\": when type is Classic, ipFamily must be IPv4 or omitted (defaults to IPv4)"
- name: Should be able to create an Ingress with NLB load balancer type and DualStackIPv4Primary ipFamily
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
loadBalancer:
platform:
type: AWS
aws:
type: NLB
ipFamily: DualStackIPv4Primary
expected: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
loadBalancer:
platform:
type: AWS
aws:
type: NLB
ipFamily: DualStackIPv4Primary
- name: Should be able to create an Ingress with NLB load balancer type and DualStackIPv6Primary ipFamily
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
loadBalancer:
platform:
type: AWS
aws:
type: NLB
ipFamily: DualStackIPv6Primary
expected: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
loadBalancer:
platform:
type: AWS
aws:
type: NLB
ipFamily: DualStackIPv6Primary
131 changes: 131 additions & 0 deletions config/v1/tests/ingresses.config.openshift.io/AWSDualStackInstall.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "Ingress"
crdName: ingresses.config.openshift.io
featureGates:
- AWSDualStackInstall
tests:
onCreate:
- name: Should be able to create an Ingress with default ipFamily
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
ipFamily: IPv4
- name: Should be able to create an Ingress with ipFamily set to IPv4
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: IPv4
expected: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: IPv4
- name: Should be able to create an Ingress with ipFamily set to DualStackIPv6Primary
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: DualStackIPv6Primary
expected: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: DualStackIPv6Primary
- name: Should be able to create an Ingress with ipFamily set to DualStackIPv4Primary
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: DualStackIPv4Primary
expected: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: DualStackIPv4Primary
- name: Should not be able to create an Ingress with invalid ipFamily value
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: InvalidValue
expectedError: "spec.ipFamily: Unsupported value: \"InvalidValue\": supported values: \"IPv4\", \"DualStackIPv6Primary\", \"DualStackIPv4Primary\""
onUpdate:
- name: Should default ipFamily to IPv4 when not specified
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
expected: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: IPv4
- name: Should not allow changing ipFamily once set
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: IPv4
updated: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: DualStackIPv6Primary
expectedError: "spec.ipFamily: Invalid value: \"string\": ipFamily is immutable once set"
- name: Should allow setting the same ipFamily value
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: DualStackIPv6Primary
updated: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: DualStackIPv6Primary
expected: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: DualStackIPv6Primary
- name: Should not allow unsetting ipFamily once it has been set
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: DualStackIPv4Primary
updated: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
expectedError: "spec.ipFamily: Invalid value: \"string\": ipFamily is immutable once set"

Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
name: "Ingress"
crdName: ingresses.config.openshift.io
featureGates:
- AzureDualStackInstall
tests:
onCreate:
- name: Should be able to create an Ingress with default ipFamily
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
ipFamily: IPv4
- name: Should be able to create an Ingress with ipFamily set to IPv4
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: IPv4
expected: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: IPv4
- name: Should be able to create an Ingress with ipFamily set to DualStackIPv6Primary
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: DualStackIPv6Primary
expected: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: DualStackIPv6Primary
- name: Should be able to create an Ingress with ipFamily set to DualStackIPv4Primary
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: DualStackIPv4Primary
expected: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: DualStackIPv4Primary
- name: Should not be able to create an Ingress with invalid ipFamily value
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: InvalidValue
expectedError: "spec.ipFamily: Unsupported value: \"InvalidValue\": supported values: \"IPv4\", \"DualStackIPv6Primary\", \"DualStackIPv4Primary\""
onUpdate:
- name: Should default ipFamily to IPv4 when not specified
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
expected: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: IPv4
- name: Should not allow changing ipFamily once set
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: IPv4
updated: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: DualStackIPv6Primary
expectedError: "spec.ipFamily: Invalid value: \"string\": ipFamily is immutable once set"
- name: Should allow setting the same ipFamily value
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: DualStackIPv6Primary
updated: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: DualStackIPv6Primary
expected: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: DualStackIPv6Primary
- name: Should not allow unsetting ipFamily once it has been set
initial: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
ipFamily: DualStackIPv4Primary
updated: |
apiVersion: config.openshift.io/v1
kind: Ingress
spec:
domain: apps.example.com
expectedError: "spec.ipFamily: Invalid value: \"string\": ipFamily is immutable once set"

Loading