From 06ed790687ffae3ae81c193dcd92628803b232b6 Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Wed, 28 Aug 2024 10:45:44 +0100 Subject: [PATCH] fix: correctly specify NO_PROXY without protocol --- charts/snyk-broker/Chart.yaml | 2 +- .../tests/broker_deployment_proxy.yaml | 62 +++++++++++++++++++ charts/snyk-broker/values.schema.json | 2 +- 3 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 charts/snyk-broker/tests/broker_deployment_proxy.yaml diff --git a/charts/snyk-broker/Chart.yaml b/charts/snyk-broker/Chart.yaml index cce3259..abe1a4e 100644 --- a/charts/snyk-broker/Chart.yaml +++ b/charts/snyk-broker/Chart.yaml @@ -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 diff --git a/charts/snyk-broker/tests/broker_deployment_proxy.yaml b/charts/snyk-broker/tests/broker_deployment_proxy.yaml new file mode 100644 index 0000000..4ec05b2 --- /dev/null +++ b/charts/snyk-broker/tests/broker_deployment_proxy.yaml @@ -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: {} diff --git a/charts/snyk-broker/values.schema.json b/charts/snyk-broker/values.schema.json index 37949dc..639c47c 100644 --- a/charts/snyk-broker/values.schema.json +++ b/charts/snyk-broker/values.schema.json @@ -290,7 +290,7 @@ "$ref": "#/$defs/urlWithSchema" }, "noProxy": { - "$ref": "#/$defs/urlWithSchema" + "$ref": "#/$defs/urlNoSchema" }, "acceptJson":{ "type": "string"