Procházet zdrojové kódy

NAS-122651 / 23.10 / hide webport when hostnetwork is enabled (#1297)

* hide webport when hostnetwork is enabled

* fix portal
Stavros Kois před 2 roky
rodič
revize
3ed6b030e7

+ 1 - 1
library/ix-dev/community/jellyfin/Chart.yaml

@@ -3,7 +3,7 @@ description: Jellyfin is a Free Software Media System that puts you in control o
 annotations:
   title: Jellyfin
 type: application
-version: 1.0.6
+version: 1.0.7
 apiVersion: v2
 appVersion: '10.8.10'
 kubeVersion: '>=1.16.0-0'

+ 9 - 8
library/ix-dev/community/jellyfin/questions.yaml

@@ -85,23 +85,24 @@ questions:
     schema:
       type: dict
       attrs:
+        - variable: hostNetwork
+          label: Host Network
+          description: |
+            Bind to the host network. While it's recommended to keep this disabled.</br>
+            It's required for autodiscovery to work.
+          schema:
+            type: boolean
+            default: false
         - variable: webPort
           label: Web Port
           description: The port for the Jellyfin Web UI.
           schema:
             type: int
             default: 30013
+            show_if: [["hostNetwork", "=", false]]
             min: 9000
             max: 65535
             required: true
-        - variable: hostNetwork
-          label: Host Network
-          description: |
-            Bind to the host network. While it's recommended to keep this disabled.</br>
-            It's required for autodiscovery to work.
-          schema:
-            type: boolean
-            default: false
 
   - variable: jellyfinStorage
     label: ""

+ 5 - 1
library/ix-dev/community/jellyfin/templates/_portal.tpl

@@ -6,7 +6,11 @@ metadata:
   name: portal
 data:
   path: "/"
-  port: {{ .Values.jellyfinNetwork.webPort | quote }}
+  {{- $port := .Values.jellyfinNetwork.webPort -}}
+  {{- if .Values.jellyfinNetwork.hostNetwork -}}
+    {{- $port = 8096 -}}
+  {{- end }}
+  port: {{ $port | quote }}
   protocol: http
   host: $node_ip
 {{- end -}}