Bläddra i källkod

Add check for env variable at chart level instead of schema

This commit introduces a change by marking env variable name/value variables as not required as UI cannot properly handle this right now.
Waqar Ahmed 4 år sedan
förälder
incheckning
06a75d2c16

+ 0 - 2
test/ipfs/1.0.1/questions.yaml

@@ -83,12 +83,10 @@ questions:
                 label: "Name"
                 schema:
                   type: string
-                  required: true
               - variable: value
                 label: "Value"
                 schema:
                   type: string
-                  required: true
 
   - variable: service
     description: "IPFS Service Configuration"

+ 4 - 0
test/ipfs/1.0.1/templates/deployment.yaml

@@ -106,8 +106,12 @@ spec:
           {{- if .Values.environment }}
           env:
             {{- range $envVariable := .Values.environment }}
+            {{- if and $envVariable.name $envVariable.value }}
             - name: {{ $envVariable.name }}
               value: {{ $envVariable.value | quote }}
+            {{- else }}
+              {{- fail "Please specify name/value for environment variable" }}
+            {{- end }}
             {{- end}}
           {{- end }}
       volumes:

+ 0 - 2
test/minio/1.0.1/questions.yaml

@@ -116,12 +116,10 @@ questions:
                 label: "Name"
                 schema:
                   type: string
-                  required: true
               - variable: value
                 label: "Value"
                 schema:
                   type: string
-                  required: true
 
   - variable: service
     description: "Minio Service Configuration"

+ 4 - 0
test/minio/1.0.1/templates/deployment.yaml

@@ -51,8 +51,12 @@ spec:
                   name: {{ template "minio.secretName" . }}
                   key: secretkey
             {{- range $envVariable := .Values.environment }}
+            {{- if and $envVariable.name $envVariable.value }}
             - name: {{ $envVariable.name }}
               value: {{ $envVariable.value | quote }}
+            {{- else }}
+              {{- fail "Please specify name/value for environment variable" }}
+            {{- end }}
             {{- end}}
       volumes:
         - name: export

+ 0 - 2
test/plex/1.0.1/questions.yaml

@@ -98,12 +98,10 @@ questions:
                 label: "Name"
                 schema:
                   type: string
-                  required: true
               - variable: value
                 label: "Value"
                 schema:
                   type: string
-                  required: true
 
   - variable: timezone
     label: "Plex container timezone"

+ 4 - 0
test/plex/1.0.1/templates/deployment.yaml

@@ -69,8 +69,12 @@ spec:
                 fieldPath: metadata.namespace
 # Extra ENV Values supplied by user
 {{- range $envVariable := .Values.environmentVariables }}
+          {{- if and $envVariable.name $envVariable.value }}
           - name: {{ $envVariable.name }}
             value: {{ $envVariable.value | quote }}
+          {{- else }}
+            {{- fail "Please specify name/value for environment variable" }}
+          {{- end }}
 {{- end}}
           readinessProbe:
             httpGet: