Skip to content

Commit

Permalink
fix: ensure all env var values are quoted (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
scme0 authored Oct 18, 2024
1 parent 78f6115 commit 28aa90c
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 21 deletions.
4 changes: 2 additions & 2 deletions charts/cf-runtime/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
description: A Helm chart for Codefresh Runner
name: cf-runtime
version: 6.4.6
version: 6.4.7
keywords:
- codefresh
- runner
Expand All @@ -18,7 +18,7 @@ annotations:
# Supported kinds: `added`, `changed`, `deprecated`, `removed`, `fixed`, `security`:
artifacthub.io/changes: |
- kind: fixed
description: "updated docker-builder version to allow users to specify the qemu image on docker builds"
description: "ensure all env vars are quoted for engine and dind pods"
dependencies:
- name: cf-common
repository: oci://quay.io/codefresh/charts
Expand Down
2 changes: 1 addition & 1 deletion charts/cf-runtime/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Codefresh Runner

![Version: 6.4.6](https://img.shields.io/badge/Version-6.4.6-informational?style=flat-square)
![Version: 6.4.7](https://img.shields.io/badge/Version-6.4.7-informational?style=flat-square)

Helm chart for deploying [Codefresh Runner](https://codefresh.io/docs/docs/installation/codefresh-runner/) to Kubernetes.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ runtimeScheduler:
envVars:
{{- with $engineContext.env }}
{{- range $key, $val := . }}
{{- if or (kindIs "bool" $val) (kindIs "int" $val) (kindIs "float64" $val) }}
{{ $key }}: {{ $val | squote }}
{{- else }}
{{ $key }}: {{ $val }}
{{- end }}
{{- end }}
{{- end }}
COMPOSE_IMAGE: {{ include "runtime.runtimeImageName" (dict "registry" $imageRegistry "imageFullName" $engineContext.runtimeImages.COMPOSE_IMAGE) | squote }}
Expand Down Expand Up @@ -103,11 +99,7 @@ dockerDaemonScheduler:
{{- with $dindContext.env }}
envVars:
{{- range $key, $val := . }}
{{- if or (kindIs "bool" $val) (kindIs "int" $val) (kindIs "float64" $val) }}
{{ $key }}: {{ $val | squote }}
{{- else }}
{{ $key }}: {{ $val }}
{{- end }}
{{- end }}
{{- end }}
cluster:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ tests:
CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS: '1000'
DOCKER_REQUEST_TIMEOUT_MS: '30000'
FORCE_COMPOSE_SERIAL_PULL: 'false'
LOGGER_LEVEL: debug
LOGGER_LEVEL: 'debug'
LOG_OUTGOING_HTTP_REQUESTS: 'false'
METRICS_PROMETHEUS_COLLECT_PROCESS_METRICS: 'false'
METRICS_PROMETHEUS_ENABLED: 'true'
METRICS_PROMETHEUS_ENABLE_LEGACY_METRICS: 'false'
METRICS_PROMETHEUS_HOST: 0.0.0.0
METRICS_PROMETHEUS_HOST: '0.0.0.0'
METRICS_PROMETHEUS_PORT: '9100'
COMPOSE_IMAGE: 'somedomain.io/codefresh/compose:tagoverride'
CONTAINER_LOGGER_IMAGE: 'somedomain.io/codefresh/cf-container-logger:tagoverride'
Expand Down
12 changes: 8 additions & 4 deletions charts/cf-runtime/tests/runtime/runtime_onprem_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,16 @@ tests:
envVars:
CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS: '1000'
DOCKER_REQUEST_TIMEOUT_MS: '30000'
FOO: BAR
FLOAT_AS_STRING: '12.34'
FOO: 'BAR'
FORCE_COMPOSE_SERIAL_PULL: 'false'
LOGGER_LEVEL: debug
INT: '123'
LOGGER_LEVEL: 'debug'
LOG_OUTGOING_HTTP_REQUESTS: 'false'
METRICS_PROMETHEUS_COLLECT_PROCESS_METRICS: 'false'
METRICS_PROMETHEUS_ENABLED: 'true'
METRICS_PROMETHEUS_ENABLE_LEGACY_METRICS: 'false'
METRICS_PROMETHEUS_HOST: 0.0.0.0
METRICS_PROMETHEUS_HOST: '0.0.0.0'
METRICS_PROMETHEUS_PORT: '9100'
COMPOSE_IMAGE: 'quay.io/codefresh/compose:tagoverride'
CONTAINER_LOGGER_IMAGE: 'quay.io/codefresh/cf-container-logger:tagoverride'
Expand Down Expand Up @@ -117,8 +119,10 @@ tests:
imagePullPolicy: IfNotPresent
userAccess: true
envVars:
ALICE: BOB
ALICE: 'BOB'
DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE: 'true'
FLOAT_AS_STRING: '12.34'
INT: '123'
cluster:
namespace: codefresh
serviceAccount: service-account-override
Expand Down
4 changes: 4 additions & 0 deletions charts/cf-runtime/tests/runtime/runtime_onprem_values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ runtime:
reuseVolumeSortOrder: pipeline_id
env:
ALICE: BOB
INT: 123
FLOAT_AS_STRING: "12.34"
podAnnotations:
karpenter.sh/do-not-evict: "true"
nodeSelector:
Expand Down Expand Up @@ -89,6 +91,8 @@ runtime:
COSIGN_IMAGE_SIGNER_IMAGE: quay.io/codefresh/cf-cosign-image-signer:tagoverride
env:
FOO: BAR
INT: 123
FLOAT_AS_STRING: "12.34"
podAnnotations:
karpenter.sh/do-not-evict: "true"
nodeSelector:
Expand Down
12 changes: 8 additions & 4 deletions charts/cf-runtime/tests/runtime/runtime_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,16 @@ tests:
envVars:
CONTAINER_LOGGER_EXEC_CHECK_INTERVAL_MS: '1000'
DOCKER_REQUEST_TIMEOUT_MS: '30000'
FOO: BAR
FLOAT: '12.34'
FOO: 'BAR'
FORCE_COMPOSE_SERIAL_PULL: 'false'
LOGGER_LEVEL: debug
INT_AS_STRING: '123'
LOGGER_LEVEL: 'debug'
LOG_OUTGOING_HTTP_REQUESTS: 'false'
METRICS_PROMETHEUS_COLLECT_PROCESS_METRICS: 'false'
METRICS_PROMETHEUS_ENABLED: 'true'
METRICS_PROMETHEUS_ENABLE_LEGACY_METRICS: 'false'
METRICS_PROMETHEUS_HOST: 0.0.0.0
METRICS_PROMETHEUS_HOST: '0.0.0.0'
METRICS_PROMETHEUS_PORT: '9100'
COMPOSE_IMAGE: 'quay.io/codefresh/compose:tagoverride'
CONTAINER_LOGGER_IMAGE: 'quay.io/codefresh/cf-container-logger:tagoverride'
Expand Down Expand Up @@ -127,8 +129,10 @@ tests:
imagePullPolicy: Always
userAccess: true
envVars:
ALICE: BOB
ALICE: 'BOB'
DOCKER_ENABLE_DEPRECATED_PULL_SCHEMA_1_IMAGE: 'true'
FLOAT: '12.34'
INT_AS_STRING: '123'
cluster:
namespace: codefresh
serviceAccount: service-account-override
Expand Down
4 changes: 4 additions & 0 deletions charts/cf-runtime/tests/runtime/runtime_values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ runtime:
reuseVolumeSortOrder: pipeline_id
env:
ALICE: BOB
INT_AS_STRING: "123"
FLOAT: 12.34
podAnnotations:
karpenter.sh/do-not-evict: 'true'
podLabels:
Expand Down Expand Up @@ -79,6 +81,8 @@ runtime:
COSIGN_IMAGE_SIGNER_IMAGE: quay.io/codefresh/cf-cosign-image-signer:tagoverride
env:
FOO: BAR
INT_AS_STRING: "123"
FLOAT: 12.34
userEnvVars:
- name: ALICE
valueFrom:
Expand Down

0 comments on commit 28aa90c

Please sign in to comment.