-
-
Notifications
You must be signed in to change notification settings - Fork 117
Ingress api version deprecation support for k8s v.1.22. fixes #277 #301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
cognifloyd
merged 6 commits into
StackStorm:master
from
arms11:ingress_api_version_k8s_122_support_issue_277
Jul 9, 2022
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6877f50
Adds k8s 1.22 support for Ingress
arms11 8fd469b
Merge branch 'master' into ingress_api_version_k8s_122_support_issue_277
cognifloyd f7b2d16
add changelog entry
cognifloyd fd61b79
add tests for ingress
cognifloyd f168716
fix ingress tests
cognifloyd 3602239
Fix var usage in Ingress with ingress.hosts
cognifloyd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,183 @@ | ||
| --- | ||
| suite: Ingress | ||
| templates: | ||
| # primary template files | ||
| - ingress.yaml | ||
|
|
||
| tests: | ||
| - it: Ingress not present if disabled | ||
| set: | ||
| ingress: | ||
| enabled: false | ||
| asserts: | ||
| - hasDocuments: | ||
| count: 0 | ||
|
|
||
| - it: Ingress is present when enabled without hosts (older k8s) | ||
| capabilities: &cap_older | ||
| majorVersion: 1 | ||
| minorVersion: 18 | ||
| apiVersions: | ||
| - networking.k8s.io/v1beta1 | ||
| set: | ||
| ingress: | ||
| enabled: true | ||
| hosts: [] | ||
| tls: [] | ||
| st2web: | ||
| service: | ||
| hostname: &st2web_hostname hostname.domain.tld | ||
| release: | ||
| name: st2ha | ||
| asserts: | ||
| - hasDocuments: | ||
| count: 1 | ||
| - equal: | ||
| path: kind | ||
| value: Ingress | ||
| # no ingress.hosts, so only st2web.hostname | ||
| - equal: &st2web_rules_host | ||
| path: spec.rules[0].host | ||
| value: *st2web_hostname | ||
| - contains: | ||
| path: spec.rules[0].http.paths | ||
| count: 1 | ||
| content: | ||
| path: "/" | ||
| backend: | ||
| serviceName: st2ha-st2web | ||
| servicePort: 80 | ||
| - isNull: | ||
| path: spec.rules[0].http.paths[0].pathType | ||
|
|
||
| - it: Ingress is present when enabled without hosts (newer k8s) | ||
| capabilities: &cap_newer | ||
| majorVersion: 1 | ||
| minorVersion: 19 | ||
| apiVersions: | ||
| - networking.k8s.io/v1 # introduced in 1.19, stable in 1.22 | ||
| - networking.k8s.io/v1beta1 | ||
| set: | ||
| ingress: | ||
| enabled: true | ||
| hosts: [] | ||
| tls: [] | ||
| st2web: | ||
| service: | ||
| hostname: *st2web_hostname | ||
| release: | ||
| name: st2ha | ||
| asserts: | ||
| - hasDocuments: | ||
| count: 1 | ||
| - equal: | ||
| path: kind | ||
| value: Ingress | ||
| # no ingress.hosts, so only st2web.hostname | ||
| - equal: *st2web_rules_host | ||
| - contains: | ||
| path: spec.rules[0].http.paths | ||
| count: 1 | ||
| content: | ||
| path: "/" | ||
| pathType: Prefix | ||
| backend: | ||
| service: | ||
| name: st2ha-st2web | ||
| port: | ||
| number: 80 | ||
|
|
||
| - it: Ingress is present when enabled with hosts (older k8s) | ||
| capabilities: *cap_older | ||
| set: | ||
| ingress: | ||
| enabled: true | ||
| hosts: &hosts | ||
| - host: *st2web_hostname | ||
| paths: | ||
| - serviceName: st2ha-st2web | ||
| servicePort: 80 | ||
| - path: /fancy-sensor | ||
| serviceName: fancy-sensor | ||
| servicePort: 8080 | ||
| tls: [] | ||
| st2web: | ||
| service: | ||
| hostname: *st2web_hostname | ||
| release: | ||
| name: st2ha | ||
| asserts: | ||
| - hasDocuments: | ||
| count: 1 | ||
| - equal: | ||
| path: kind | ||
| value: Ingress | ||
| # no ingress.hosts, so only st2web.hostname | ||
| - equal: *st2web_rules_host | ||
| - equal: &host_path_is_root_glob | ||
| path: spec.rules[0].http.paths[0].path | ||
| value: "/*" | ||
| - isNull: | ||
| path: spec.rules[0].http.paths[0].pathType | ||
| - equal: | ||
| path: spec.rules[0].http.paths[0].backend | ||
| value: | ||
| serviceName: st2ha-st2web | ||
| servicePort: 80 | ||
|
|
||
| - equal: | ||
| path: spec.rules[0].http.paths[1].path | ||
| value: "/fancy-sensor" | ||
| - isNull: | ||
| path: spec.rules[0].http.paths[1].pathType | ||
| - equal: | ||
| path: spec.rules[0].http.paths[1].backend | ||
| value: | ||
| serviceName: fancy-sensor | ||
| servicePort: 8080 | ||
|
|
||
| - it: Ingress is present when enabled with hosts (newer k8s) | ||
| capabilities: *cap_newer | ||
| set: | ||
| ingress: | ||
| enabled: true | ||
| hosts: *hosts | ||
| tls: [] | ||
| st2web: | ||
| service: | ||
| hostname: *st2web_hostname | ||
| release: | ||
| name: st2ha | ||
| asserts: | ||
| - hasDocuments: | ||
| count: 1 | ||
| - equal: | ||
| path: kind | ||
| value: Ingress | ||
| # no ingress.hosts, so only st2web.hostname | ||
| - equal: *st2web_rules_host | ||
| - equal: *host_path_is_root_glob | ||
| - equal: | ||
| path: spec.rules[0].http.paths[0].pathType | ||
| value: Prefix | ||
| - equal: | ||
| path: spec.rules[0].http.paths[0].backend | ||
| value: | ||
| service: | ||
| name: st2ha-st2web | ||
| port: | ||
| number: 80 | ||
|
|
||
| - equal: | ||
| path: spec.rules[0].http.paths[1].path | ||
| value: "/fancy-sensor" | ||
| - equal: | ||
| path: spec.rules[0].http.paths[1].pathType | ||
| value: Prefix | ||
| - equal: | ||
| path: spec.rules[0].http.paths[1].backend | ||
| value: | ||
| service: | ||
| name: fancy-sensor | ||
| port: | ||
| number: 8080 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests uncovered a bug here. It was missing
$so I added that.