From 1faeaf625819e3affb50f3de253cd64fa8debbe1 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Thu, 10 Nov 2022 23:54:31 +0200 Subject: [PATCH] Make some inputs safe --- .../tests/pod/deployment_container_default_test.yaml | 6 ++++-- .../1.0.0/templates/lib/controller/_container.tpl | 12 ++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/library/common-test/tests/pod/deployment_container_default_test.yaml b/library/common-test/tests/pod/deployment_container_default_test.yaml index 3e8ae4fe..a0cf7b04 100644 --- a/library/common-test/tests/pod/deployment_container_default_test.yaml +++ b/library/common-test/tests/pod/deployment_container_default_test.yaml @@ -20,12 +20,14 @@ tests: - isNull: documentIndex: *deploymentDoc path: spec.template.spec.containers[0].args - - isNull: + - equal: documentIndex: *deploymentDoc path: spec.template.spec.containers[0].tty - - isNull: + value: false + - equal: documentIndex: *deploymentDoc path: spec.template.spec.containers[0].stdin + value: false - isNull: documentIndex: *deploymentDoc path: spec.template.spec.containers[0].lifecycle diff --git a/library/common/1.0.0/templates/lib/controller/_container.tpl b/library/common/1.0.0/templates/lib/controller/_container.tpl index 04080b56..5b8e4519 100644 --- a/library/common/1.0.0/templates/lib/controller/_container.tpl +++ b/library/common/1.0.0/templates/lib/controller/_container.tpl @@ -28,11 +28,15 @@ {{- end }} {{- end }} {{- end }} - {{- with .Values.tty }} - tty: {{ . }} + {{- if .Values.tty }} + tty: true + {{- else }} + tty: false {{- end }} - {{- with .Values.stdin }} - stdin: {{ . }} + {{- if .Values.stdin }} + stdin: true + {{- else }} + stdin: false {{- end }} {{- with .Values.securityContext }} securityContext: {{/* TODO: Add validation for runAsNonRoot / runAsUser|runAsGroup 0*/}}