From 9ee0dfe403a2e39efb2ba860467b43bf08447ba6 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten-Lebbing Date: Thu, 13 Jan 2022 11:43:26 +0100 Subject: [PATCH] feat(Common): properly setup extra-args support (#1708) --- charts/library/common/Chart.yaml | 2 +- .../templates/lib/controller/_container.tpl | 11 ++++++++++- charts/library/common/values.yaml | 5 +++++ templates/questions/controllerExpert.yaml | 15 +++------------ 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/charts/library/common/Chart.yaml b/charts/library/common/Chart.yaml index b3c78e0d8f1..4875f126f92 100644 --- a/charts/library/common/Chart.yaml +++ b/charts/library/common/Chart.yaml @@ -15,4 +15,4 @@ maintainers: name: common sources: null type: library -version: 8.12.1 +version: 8.12.2 diff --git a/charts/library/common/templates/lib/controller/_container.tpl b/charts/library/common/templates/lib/controller/_container.tpl index 2af624711b8..9c750357686 100644 --- a/charts/library/common/templates/lib/controller/_container.tpl +++ b/charts/library/common/templates/lib/controller/_container.tpl @@ -11,14 +11,23 @@ {{ toYaml . | nindent 4 }} {{- end }} {{- end }} - {{- with .Values.args }} + {{- if or ( .Values.extraArgs ) ( .Values.args ) }} args: + {{- with .Values.args }} {{- if kindIs "string" . }} - {{ . }} {{- else }} {{ toYaml . | nindent 4 }} {{- end }} {{- end }} + {{- with .Values.extraArgs }} + {{- if kindIs "string" . }} + - {{ . }} + {{- else }} + {{ toYaml . | nindent 4 }} + {{- end }} + {{- end }} + {{- end }} tty: {{ .Values.tty }} stdin: {{ .Values.stdin }} {{- with .Values.securityContext }} diff --git a/charts/library/common/values.yaml b/charts/library/common/values.yaml index 077b5ba22be..82efc0db678 100644 --- a/charts/library/common/values.yaml +++ b/charts/library/common/values.yaml @@ -125,9 +125,14 @@ imageSelector: "image" # -- Override the command(s) for the default container command: [] + # -- Override the args for the default container args: [] +# -- Add args in addition to the arguments set by default. +# Primarily for the SCALE GUI +extraArgs: [] + # -- Set the primary portal for TrueNAS SCALE portal: # -- enable generation of the portal configmap diff --git a/templates/questions/controllerExpert.yaml b/templates/questions/controllerExpert.yaml index 959c975eaec..07490648649 100644 --- a/templates/questions/controllerExpert.yaml +++ b/templates/questions/controllerExpert.yaml @@ -11,19 +11,10 @@ type: list default: [] items: - - variable: argItem - label: "Arg" + - variable: arg + label: "arg" schema: - type: dict - attrs: - - variable: name - label: "Name" - schema: - type: string - - variable: value - label: "Value" - schema: - type: string + type: string - variable: labelsList label: "Controller Labels" schema: