Skip to content

Commit

Permalink
fix: correctly specify NO_PROXY without protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
soniqua committed Aug 28, 2024
1 parent 0492126 commit 06ed790
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/snyk-broker/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: snyk-broker
version: 2.7.4
version: 2.7.5
description: A Helm chart for Kubernetes
type: application
62 changes: 62 additions & 0 deletions charts/snyk-broker/tests/broker_deployment_proxy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 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:
httpsProxy: my.ghe.io
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: NO_PROXY
value: my.ghe.io
- it: rejects noproxy with protocol
set:
httpsProxy: https://my.ghe.io
asserts:
- failedTemplate: {}
2 changes: 1 addition & 1 deletion charts/snyk-broker/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
"$ref": "#/$defs/urlWithSchema"
},
"noProxy": {
"$ref": "#/$defs/urlWithSchema"
"$ref": "#/$defs/urlNoSchema"
},
"acceptJson":{
"type": "string"
Expand Down

0 comments on commit 06ed790

Please sign in to comment.