-
Notifications
You must be signed in to change notification settings - Fork 24
feat: add tls and hosts values override for more flexibility #828
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
michaellzc
merged 1 commit into
main
from
03-04-feat_add_tls_and_hosts_values_override_for_more_flexibility
Mar 4, 2026
Merged
Changes from all commits
Commits
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,6 @@ | ||
| frontend: | ||
| ingress: | ||
| enabled: true | ||
| hosts: | ||
| - host: sourcegraph.example.com | ||
| - host: other.example.com |
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,92 @@ | ||
| suite: frontendIngress | ||
| templates: | ||
| - frontend/sourcegraph-frontend.Ingress.yaml | ||
| tests: | ||
| # Backward-compatible: host + tlsSecret | ||
| - it: should render tls block with secretName when both host and tlsSecret are set | ||
| set: | ||
| frontend.ingress.enabled: true | ||
| frontend.ingress.host: sourcegraph.example.com | ||
| frontend.ingress.tlsSecret: sourcegraph-tls | ||
| asserts: | ||
| - equal: | ||
| path: spec.tls[0].hosts[0] | ||
| value: sourcegraph.example.com | ||
| - equal: | ||
| path: spec.tls[0].secretName | ||
| value: sourcegraph-tls | ||
| - equal: | ||
| path: spec.rules[0].host | ||
| value: sourcegraph.example.com | ||
|
|
||
| # Backward-compatible: host only → no tls block (use tls list for TLS without a secret) | ||
| - it: should not render tls block when host is set but tlsSecret is not | ||
| set: | ||
| frontend.ingress.enabled: true | ||
| frontend.ingress.host: sourcegraph.example.com | ||
| asserts: | ||
| - notExists: | ||
| path: spec.tls | ||
|
|
||
| # Backward-compatible: no tls when host is not set | ||
| - it: should not render tls block when host is not set | ||
| set: | ||
| frontend.ingress.enabled: true | ||
| asserts: | ||
| - notExists: | ||
| path: spec.tls | ||
|
|
||
| # New: hosts list creates one rule per host | ||
| - it: should render rules per host when hosts list is set | ||
| values: | ||
| - frontendIngress_hosts.yaml | ||
| asserts: | ||
| - equal: | ||
| path: spec.rules[0].host | ||
| value: sourcegraph.example.com | ||
| - equal: | ||
| path: spec.rules[1].host | ||
| value: other.example.com | ||
|
|
||
| # New: tls list with secretName | ||
| - it: should render tls from tls list | ||
| values: | ||
| - frontendIngress_tls.yaml | ||
| asserts: | ||
| - equal: | ||
| path: spec.tls[0].hosts[0] | ||
| value: sourcegraph.example.com | ||
| - equal: | ||
| path: spec.tls[0].secretName | ||
| value: sourcegraph-tls | ||
|
|
||
| # New: tls list without secretName (e.g. Tailscale) | ||
| - it: should render tls block without secretName when tls list omits secretName | ||
| values: | ||
| - frontendIngress_tlsNoSecret.yaml | ||
| asserts: | ||
| - equal: | ||
| path: spec.tls[0].hosts[0] | ||
| value: sourcegraph.example.com | ||
| - notExists: | ||
| path: spec.tls[0].secretName | ||
|
|
||
| # Error: hosts and host both set | ||
| - it: should fail when both hosts and host are set | ||
| values: | ||
| - frontendIngress_hosts.yaml | ||
| set: | ||
| frontend.ingress.host: sourcegraph.example.com | ||
| asserts: | ||
| - failedTemplate: | ||
| errorMessage: frontend.ingress.hosts and frontend.ingress.host cannot both be set | ||
|
|
||
| # Error: tls and tlsSecret both set | ||
| - it: should fail when both tls and tlsSecret are set | ||
| values: | ||
| - frontendIngress_tls.yaml | ||
| set: | ||
| frontend.ingress.tlsSecret: sourcegraph-tls | ||
| asserts: | ||
| - failedTemplate: | ||
| errorMessage: frontend.ingress.tls and frontend.ingress.tlsSecret cannot both be set | ||
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,7 @@ | ||
| frontend: | ||
| ingress: | ||
| enabled: true | ||
| tls: | ||
| - hosts: | ||
| - sourcegraph.example.com | ||
| secretName: sourcegraph-tls |
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,6 @@ | ||
| frontend: | ||
| ingress: | ||
| enabled: true | ||
| tls: | ||
| - hosts: | ||
| - sourcegraph.example.com |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.