add rules tests with targetSel

This commit is contained in:
Stavros kois
2023-12-07 17:13:21 +02:00
parent e77f496528
commit 2277892fab

View File

@@ -26,7 +26,7 @@ tests:
enabled: true
primary: true
ingressClassName: some-class
hosts: &hosts
hosts:
- host: test-host
paths:
- path: /test-path
@@ -79,9 +79,7 @@ tests:
overrideService:
name: other-service
port: 8080
integrations: &integrations
traefik:
enabled: false
integrations: *integrations
asserts:
- documentIndex: &ingressDoc 1
isKind:
@@ -121,3 +119,81 @@ tests:
name: other-service
port:
number: 8080
- it: should pass with ingress created with rules with targetSelector
set:
operator: &operator
verify:
enabled: false
service:
my-service:
enabled: true
primary: true
ports:
main:
enabled: true
primary: true
port: 80
my-service2:
enabled: true
ports:
my-port2:
enabled: true
port: 9000
ingress:
my-ingress:
enabled: true
primary: true
targetSelector:
my-service2: my-port2
hosts: &hosts
- host: test-host
paths:
- path: /test-path
- host: test-other-host
paths:
- path: /test-other-path
- path: /test-other-path2
overrideService:
name: other-service
port: 8080
integrations: *integrations
asserts:
- documentIndex: &ingressDoc 2
isKind:
of: Ingress
- documentIndex: *ingressDoc
equal:
path: metadata.name
value: test-release-name-common-test
- documentIndex: *ingressDoc
equal:
path: spec.rules
value:
- host: test-host
http:
paths:
- path: /test-path
pathType: Prefix
backend:
service:
name: test-release-name-common-test-my-service2
port:
number: 9000
- host: test-other-host
http:
paths:
- path: /test-other-path
pathType: Prefix
backend:
service:
name: test-release-name-common-test-my-service2
port:
number: 9000
- path: /test-other-path2
pathType: Prefix
backend:
service:
name: other-service
port:
number: 8080