-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update tests according to the improved routing rules.
Add tests for VSR split traffic and advanced routing. Add tests for focused canary deployment.
- Loading branch information
Showing
58 changed files
with
995 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
tests/data/virtual-server-focused-canary/standard/virtual-server.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apiVersion: k8s.nginx.org/v1alpha1 | ||
kind: VirtualServer | ||
metadata: | ||
name: virtual-server-canary | ||
spec: | ||
host: virtual-server-canary.example.com | ||
upstreams: | ||
- name: backend1 | ||
service: backend1-svc | ||
port: 80 | ||
- name: backend2 | ||
service: backend2-svc | ||
port: 80 | ||
routes: | ||
- path: "/backends/focused-canary" | ||
matches: | ||
- conditions: | ||
- header: x-version | ||
value: canary | ||
splits: | ||
- weight: 90 | ||
action: | ||
pass: backend1 | ||
- weight: 10 | ||
action: | ||
pass: backend2 | ||
action: | ||
pass: backend1 | ||
- path: "/backend2" | ||
action: | ||
pass: backend2 |
9 changes: 9 additions & 0 deletions
9
tests/data/virtual-server-route-advanced-routing/standard/virtual-server.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: k8s.nginx.org/v1alpha1 | ||
kind: VirtualServer | ||
metadata: | ||
name: virtual-server-route | ||
spec: | ||
host: virtual-server-route.example.com | ||
routes: | ||
- path: "/backends" | ||
route: backends-namespace/backends |
37 changes: 37 additions & 0 deletions
37
tests/data/virtual-server-route-advanced-routing/virtual-server-route-argument.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
apiVersion: k8s.nginx.org/v1alpha1 | ||
kind: VirtualServerRoute | ||
metadata: | ||
name: backends | ||
spec: | ||
host: virtual-server-route.example.com | ||
upstreams: | ||
- name: backend2 | ||
service: backend2-svc | ||
port: 80 | ||
- name: backend4-stable | ||
service: backend4-stable-svc | ||
port: 80 | ||
- name: backend1-future | ||
service: backend1-future-svc | ||
port: 80 | ||
- name: backend3-deprecated | ||
service: backend3-deprecated-svc | ||
port: 80 | ||
subroutes: | ||
- path: "/backends/backend1" | ||
matches: | ||
- conditions: | ||
- argument: arg1 | ||
value: v1 | ||
action: | ||
pass: backend1-future | ||
- conditions: | ||
- argument: arg1 | ||
value: v2 | ||
action: | ||
pass: backend3-deprecated | ||
action: | ||
pass: backend4-stable | ||
- path: "/backends/backend2" | ||
action: | ||
pass: backend2 |
49 changes: 49 additions & 0 deletions
49
tests/data/virtual-server-route-advanced-routing/virtual-server-route-complex.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
apiVersion: k8s.nginx.org/v1alpha1 | ||
kind: VirtualServerRoute | ||
metadata: | ||
name: backends | ||
spec: | ||
host: virtual-server-route.example.com | ||
upstreams: | ||
- name: backend2 | ||
service: backend2-svc | ||
port: 80 | ||
- name: backend4-stable | ||
service: backend4-stable-svc | ||
port: 80 | ||
- name: backend1-future | ||
service: backend1-future-svc | ||
port: 80 | ||
- name: backend3-deprecated | ||
service: backend3-deprecated-svc | ||
port: 80 | ||
subroutes: | ||
- path: "/backends/backend1" | ||
matches: | ||
- conditions: | ||
- header: x-version | ||
value: future | ||
- cookie: user | ||
value: some | ||
- argument: arg1 | ||
value: v1 | ||
- variable: $request_method | ||
value: get | ||
action: | ||
pass: backend1-future | ||
- conditions: | ||
- header: x-version | ||
value: deprecated | ||
- cookie: user | ||
value: bad | ||
- argument: arg1 | ||
value: v2 | ||
- variable: $request_method | ||
value: post | ||
action: | ||
pass: backend3-deprecated | ||
action: | ||
pass: backend4-stable | ||
- path: "/backends/backend2" | ||
action: | ||
pass: backend2 |
37 changes: 37 additions & 0 deletions
37
tests/data/virtual-server-route-advanced-routing/virtual-server-route-cookie.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
apiVersion: k8s.nginx.org/v1alpha1 | ||
kind: VirtualServerRoute | ||
metadata: | ||
name: backends | ||
spec: | ||
host: virtual-server-route.example.com | ||
upstreams: | ||
- name: backend2 | ||
service: backend2-svc | ||
port: 80 | ||
- name: backend4-stable | ||
service: backend4-stable-svc | ||
port: 80 | ||
- name: backend1-future | ||
service: backend1-future-svc | ||
port: 80 | ||
- name: backend3-deprecated | ||
service: backend3-deprecated-svc | ||
port: 80 | ||
subroutes: | ||
- path: "/backends/backend1" | ||
matches: | ||
- conditions: | ||
- cookie: user | ||
value: some | ||
action: | ||
pass: backend1-future | ||
- conditions: | ||
- cookie: user | ||
value: bad | ||
action: | ||
pass: backend3-deprecated | ||
action: | ||
pass: backend4-stable | ||
- path: "/backends/backend2" | ||
action: | ||
pass: backend2 |
Oops, something went wrong.