This repository has been archived by the owner on Jun 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for nonroot IngressRoutes
Fixes #19. Signed-off-by: Nick Young <ynick@vmware.com>
- Loading branch information
Showing
12 changed files
with
325 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
mkdir -p internal/$1/testdata/$2 | ||
touch internal/$1/testdata/$2/input.yaml | ||
touch internal/$1/testdata/$2/output.yaml | ||
touch internal/$1/testdata/$2/errors.txt | ||
|
1 change: 1 addition & 0 deletions
1
internal/translator/testdata/nonroot-multiplematches/errors.txt
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 @@ | ||
The guess for the IngressRoute include path is /foo. HTTPProxy prefix conditions should not include the include prefix. Please check this value is correct. See https://projectcontour.io/docs/master/httpproxy/#conditions-and-inclusion |
16 changes: 16 additions & 0 deletions
16
internal/translator/testdata/nonroot-multiplematches/input.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,16 @@ | ||
--- | ||
apiVersion: contour.heptio.com/v1beta1 | ||
kind: IngressRoute | ||
metadata: | ||
name: nonroot-slash-match | ||
namespace: default | ||
spec: | ||
routes: | ||
- match: /foo/bar | ||
services: | ||
- name: s1 | ||
port: 80 | ||
- match: /foo/baz | ||
services: | ||
- name: s1 | ||
port: 80 |
19 changes: 19 additions & 0 deletions
19
internal/translator/testdata/nonroot-multiplematches/output.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,19 @@ | ||
--- | ||
apiVersion: projectcontour.io/v1 | ||
kind: HTTPProxy | ||
metadata: | ||
name: nonroot-slash-match | ||
namespace: default | ||
spec: | ||
routes: | ||
- conditions: | ||
- prefix: /bar | ||
services: | ||
- name: s1 | ||
port: 80 | ||
- conditions: | ||
- prefix: /baz | ||
services: | ||
- name: s1 | ||
port: 80 | ||
status: {} |
Empty file.
12 changes: 12 additions & 0 deletions
12
internal/translator/testdata/nonroot-singleslashmatch/input.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,12 @@ | ||
--- | ||
apiVersion: contour.heptio.com/v1beta1 | ||
kind: IngressRoute | ||
metadata: | ||
name: nonroot-slash-match | ||
namespace: default | ||
spec: | ||
routes: | ||
- match: / | ||
services: | ||
- name: s1 | ||
port: 80 |
14 changes: 14 additions & 0 deletions
14
internal/translator/testdata/nonroot-singleslashmatch/output.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,14 @@ | ||
--- | ||
apiVersion: projectcontour.io/v1 | ||
kind: HTTPProxy | ||
metadata: | ||
name: nonroot-slash-match | ||
namespace: default | ||
spec: | ||
routes: | ||
- conditions: | ||
- prefix: / | ||
services: | ||
- name: s1 | ||
port: 80 | ||
status: {} |
1 change: 1 addition & 0 deletions
1
internal/translator/testdata/nonroot_ambiguous_prefix/errors.txt
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 @@ | ||
Can't determine include path from single match /foo/bar. HTTPProxy prefix conditions should not include the include prefix. Please check this value is correct. See https://projectcontour.io/docs/master/httpproxy/#conditions-and-inclusion |
12 changes: 12 additions & 0 deletions
12
internal/translator/testdata/nonroot_ambiguous_prefix/input.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,12 @@ | ||
--- | ||
apiVersion: contour.heptio.com/v1beta1 | ||
kind: IngressRoute | ||
metadata: | ||
name: nonroot-ambiguous-match | ||
namespace: default | ||
spec: | ||
routes: | ||
- match: /foo/bar | ||
services: | ||
- name: s1 | ||
port: 80 |
14 changes: 14 additions & 0 deletions
14
internal/translator/testdata/nonroot_ambiguous_prefix/output.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,14 @@ | ||
--- | ||
apiVersion: projectcontour.io/v1 | ||
kind: HTTPProxy | ||
metadata: | ||
name: nonroot-ambiguous-match | ||
namespace: default | ||
spec: | ||
routes: | ||
- conditions: | ||
- prefix: /foo/bar | ||
services: | ||
- name: s1 | ||
port: 80 | ||
status: {} |
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
Oops, something went wrong.