-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/make-servicename-k8s-api-compliant
- Loading branch information
Showing
10 changed files
with
259 additions
and
14 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 @@ | ||
607a5d5d16b365165d8636e526ed92a2ea116719:charts/snyk-broker/tests/broker_deployment_ca_test.yaml:private-key:271 |
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
93 changes: 93 additions & 0 deletions
93
charts/snyk-broker/tests/broker_cra_deployment_disable_tls_test.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,93 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json | ||
suite: test broker deployment with CA | ||
chart: | ||
version: 0.0.0 | ||
templates: | ||
- broker_deployment.yaml | ||
- cra_deployment.yaml | ||
- code_agent_deployment.yaml | ||
values: | ||
- ./fixtures/default_values.yaml | ||
- ./fixtures/default_values_cra.yaml | ||
set: | ||
enableCodeAgent: true | ||
|
||
tests: | ||
- it: disables tls trust with "disable" (string) | ||
set: | ||
tlsRejectUnauthorized: "disable" | ||
asserts: | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: NODE_TLS_REJECT_UNAUTHORIZED | ||
value: "0" | ||
documentSelector: | ||
path: kind | ||
value: Deployment | ||
- it: disables tls trust with "0" (string) | ||
set: | ||
tlsRejectUnauthorized: "0" | ||
asserts: | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: NODE_TLS_REJECT_UNAUTHORIZED | ||
value: "0" | ||
documentSelector: | ||
path: kind | ||
value: Deployment | ||
- it: disables tls trust with "false" (string) | ||
set: | ||
tlsRejectUnauthorized: "false" | ||
asserts: | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: NODE_TLS_REJECT_UNAUTHORIZED | ||
value: "0" | ||
documentSelector: | ||
path: kind | ||
value: Deployment | ||
- it: disables tls trust with false (boolean) | ||
set: | ||
tlsRejectUnauthorized: false | ||
asserts: | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: NODE_TLS_REJECT_UNAUTHORIZED | ||
value: "0" | ||
documentSelector: | ||
path: kind | ||
value: Deployment | ||
- it: disables tls trust with '0' (integer) | ||
set: | ||
tlsRejectUnauthorized: 0 | ||
asserts: | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: NODE_TLS_REJECT_UNAUTHORIZED | ||
value: "0" | ||
documentSelector: | ||
path: kind | ||
value: Deployment | ||
- it: enables tls trust by default "" (string) | ||
set: | ||
tlsRejectUnauthorized: "" | ||
asserts: | ||
- notContains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: NODE_TLS_REJECT_UNAUTHORIZED | ||
value: "0" | ||
documentSelector: | ||
path: kind | ||
value: Deployment | ||
- it: does not allow true (bool) | ||
set: | ||
tlsRejectUnauthorized: true | ||
asserts: | ||
- failedTemplate: | ||
errorMessage: "values don't meet the specifications of the schema(s) in the following chart(s):\nsnyk-broker:\n- tlsRejectUnauthorized: tlsRejectUnauthorized must be one of the following: \"\", 0, \"0\", \"false\", false, \"disable\"\n" |
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
99 changes: 99 additions & 0 deletions
99
charts/snyk-broker/tests/broker_deployment_proxy_test.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,99 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json | ||
suite: test broker proxy configuration | ||
chart: | ||
version: 0.0.0 | ||
templates: | ||
- broker_deployment.yaml | ||
values: | ||
- ./fixtures/default_values.yaml | ||
|
||
tests: | ||
- it: sets an https proxy | ||
set: | ||
httpsProxy: &proxy http://my.proxy:8080 | ||
asserts: | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: HTTPS_PROXY | ||
value: *proxy | ||
- it: sets an http proxy | ||
set: | ||
httpProxy: *proxy | ||
asserts: | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: HTTP_PROXY | ||
value: *proxy | ||
- it: sets both https and http proxy | ||
set: | ||
httpProxy: *proxy | ||
httpsProxy: *proxy | ||
asserts: | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: HTTP_PROXY | ||
value: *proxy | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: HTTPS_PROXY | ||
value: *proxy | ||
- it: rejects proxy without protocol | ||
set: | ||
httpsProxy: no.protocol.proxy:8080 | ||
asserts: | ||
- failedTemplate: {} | ||
- it: sets noproxy without protocol | ||
set: | ||
noProxy: my.ghe.io | ||
asserts: | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: NO_PROXY | ||
value: my.ghe.io | ||
- it: corrects noproxy by removing protocol | ||
set: | ||
noProxy: https://my.ghe.io | ||
asserts: | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: NO_PROXY | ||
value: my.ghe.io | ||
- it: sets noproxy with multiple domains | ||
set: | ||
noProxy: my.ghe.io,my.other.host.tld | ||
asserts: | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: NO_PROXY | ||
value: my.ghe.io,my.other.host.tld | ||
- it: corrects noproxy with multiple domains, one with protocol | ||
set: | ||
noProxy: my.ghe.io,https://my.private.site | ||
asserts: | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: NO_PROXY | ||
value: my.ghe.io,my.private.site | ||
- it: corrects noproxy with multiple domains, one with protocol, with spaces | ||
set: | ||
noProxy: my.ghe.io, https://my.private.site | ||
asserts: | ||
- contains: | ||
path: spec.template.spec.containers[0].env | ||
content: | ||
name: NO_PROXY | ||
value: my.ghe.io,my.private.site | ||
- it: rejects noproxy with multiple domains, one with protocol, one with a port | ||
set: | ||
noProxy: my.ghe.io, https://my.private.site,notadomain:12334 | ||
asserts: | ||
- failedTemplate: | ||
errorMessage: Entry notadomain:12334 for .Values.noProxy is invalid. Specify hostname only (no schema or port) |
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