Procházet zdrojové kódy

Allow specifying environment variables for chia

Waqar Ahmed před 4 roky
rodič
revize
baad4254e4

+ 0 - 3
charts/chia/1.1.0/ix_values.yaml

@@ -3,6 +3,3 @@ image:
   tag: 1.1.4
   pullPolicy: IfNotPresent
 updateStrategy: Recreate
-environmentVariables:
-  - name: "keys"
-    value: "/plots/keyfile"

+ 23 - 0
charts/chia/1.1.0/questions.yaml

@@ -1,6 +1,8 @@
 groups:
   - name: "Storage"
     description: "Configure Storage for Chia"
+  - name: "Chia Environment Variables"
+    description: "Set the environment that will be visible to the container"
 
 questions:
   - variable: appVolumeMounts
@@ -104,3 +106,24 @@ questions:
                 schema:
                   type: hostpath
                   required: true
+
+  - variable: environmentVariables
+    label: "Environment Variables for Chia"
+    group: "Chia Environment Variables"
+    schema:
+      type: list
+      default: []
+      items:
+        - variable: environmentVariable
+          label: "Environment Variable"
+          schema:
+            type: dict
+            attrs:
+              - variable: name
+                label: "Name"
+                schema:
+                  type: string
+              - variable: value
+                label: "Value"
+                schema:
+                  type: string

+ 3 - 1
charts/chia/1.1.0/templates/deployment.yaml

@@ -28,7 +28,9 @@ spec:
               protocol: TCP
               containerPort: 8444
               hostPort: 8444
-{{ include "common.containers.allEnvironmentVariables" .Values | nindent 10 }}
+          {{ $envList := (default list .Values.environmentVariables) }}
+          {{ $envList = mustAppend $envList (dict "name" "keys" "value" "/plots/keyfile") }}
+          {{ include "common.containers.allEnvironmentVariables" (dict "environmentVariables" $envList) | nindent 10 }}
       volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
       {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
         - name: extrappvolume-{{ $index }}

+ 0 - 3
charts/chia/1.1.0/test_values.yaml

@@ -3,9 +3,6 @@ image:
   tag: 1.1.4
   pullPolicy: IfNotPresent
 updateStrategy: Recreate
-environmentVariables:
-  - name: "keys"
-    value: "/plots/keyfile"
 
 appVolumeMounts:
   staging: