浏览代码

Do not append port twice on server_name (#1570)

* Do not append port twice on server_name

* update test
Stavros Kois 1 年之前
父节点
当前提交
7640b88cff

+ 1 - 1
library/ix-dev/charts/collabora/Chart.yaml

@@ -5,7 +5,7 @@ description: |
 annotations:
   title: Collabora
 type: application
-version: 1.2.16
+version: 1.2.17
 apiVersion: v2
 appVersion: 23.05.4.2.1
 kubeVersion: '>=1.16.0-0'

+ 1 - 1
library/ix-dev/charts/collabora/ci/https-values.yaml

@@ -7,7 +7,7 @@ config:
   extra_params: --o:welcome.enable=false --o:user_interface.mode=notebookbar --o:ssl.termination=true
     --o:ssl.enable=false --o:net.proto=IPv4 --o:net.post_allow.host[0]=.+ --o:storage.wopi.host[0]=.+
   password: changeme
-  server_name: ssh.sonicaj.com:49980
+  server_name: ssh.sonicaj.com
   timezone: Asia/Karachi
   username: admin
 ixChartContext:

+ 4 - 1
library/ix-dev/charts/collabora/questions.yaml

@@ -64,7 +64,10 @@ questions:
             default: "--o:welcome.enable=false --o:user_interface.mode=notebookbar --o:ssl.termination=true --o:ssl.enable=false --o:net.proto=IPv4 --o:net.post_allow.host[0]=.+ --o:storage.wopi.host[0]=.+"
         - variable: server_name
           label: "Server Name"
-          description: "When this environment variable is set (is not “”), then its value will be used as server name in /etc/loolwsd/loolwsd.xml. Without this, CODE is not delivering a correct host for the websocket connection in case of a proxy in front of it."
+          description: |
+            When this environment variable is set (is not “”), then its value will be used as server name in /etc/loolwsd/loolwsd.xml.
+            Without this, CODE is not delivering a correct host for the websocket connection in case of a proxy in front of it.</br>
+            If a port is not specified, the below configured Node Port will be used.
           schema:
             type: string
             $ref:

+ 5 - 1
library/ix-dev/charts/collabora/templates/deployment.yaml

@@ -117,7 +117,11 @@ spec:
           {{ $envList = mustAppend $envList (dict "name" "dictionaries" "value" $envConfig.dictionaries) }}
           {{ $envList = mustAppend $envList (dict "name" "extra_params" "value" $envConfig.extra_params) }}
           {{ $envList = mustAppend $envList (dict "name" "DONT_GEN_SSL_CERT" "value" "true") }}
-          {{ $envList = mustAppend $envList (dict "name" "server_name" "value" (printf "%v:%v" $envConfig.server_name .Values.nodePort)) }}
+          {{ if not (contains ":" $envConfig.server_name) }}
+            {{ $envList = mustAppend $envList (dict "name" "server_name" "value" (printf "%v:%v" $envConfig.server_name .Values.nodePort)) }}
+          {{ else }}
+            {{ $envList = mustAppend $envList (dict "name" "server_name" "value" (printf "%v" $envConfig.server_name)) }}
+          {{ end }}
           {{ $envList = mustAppend $envList (dict "name" "username" "valueFromSecret" true "secretName" $secretName "secretKey" "username") }}
           {{ $envList = mustAppend $envList (dict "name" "password" "valueFromSecret" true "secretName" $secretName "secretKey" "password") }}
           {{ include "common.containers.allEnvironmentVariables" (dict "environmentVariables" $envList) | nindent 10 }}