Skip to content

Commit 38d07a8

Browse files
authored
fix: render vars with new expression (#2328) (#2329)
1 parent f4cb337 commit 38d07a8

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

addons/mongodb/templates/cmpd.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ spec:
326326
port:
327327
name: mongodb
328328
option: Optional
329-
expression: {{ `{{if ne (index . "KB_SERVICE_PORT") ""}}{{.KB_SERVICE_PORT}}{{else}}27017{{end}}` | toYaml }}
329+
expression: {{ `{{if index . "KB_SERVICE_PORT"}}{{.KB_SERVICE_PORT}}{{else}}27017{{end}}` | toYaml }}
330330
- name: SYNCER_SERVICE_PORT
331331
valueFrom:
332332
hostNetworkVarRef:
@@ -345,7 +345,7 @@ spec:
345345
port:
346346
name: exporter
347347
option: Optional
348-
expression: {{ `{{if ne (index . "EXPORTER_SERVICE_PORT") ""}}{{.EXPORTER_SERVICE_PORT}}{{else}}9216{{end}}` | toYaml }}
348+
expression: {{ `{{if index . "EXPORTER_SERVICE_PORT"}}{{.EXPORTER_SERVICE_PORT}}{{else}}9216{{end}}` | toYaml }}
349349
hostNetwork:
350350
containerPorts:
351351
- container: mongodb

addons/oceanbase-ce/templates/_helpers.tpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ vars:
168168
name: sql
169169
option: Optional
170170
optional: true
171-
expression: {{ `{{if ne (index . "OB_SERVICE_PORT") ""}}{{.OB_SERVICE_PORT}}{{else}}2881{{end}}` | toYaml }}
171+
expression: {{ `{{if index . "OB_SERVICE_PORT"}}{{.OB_SERVICE_PORT}}{{else}}2881{{end}}` | toYaml }}
172172
- name: OB_RPC_PORT
173173
valueFrom:
174174
hostNetworkVarRef:
@@ -178,7 +178,7 @@ vars:
178178
name: rpc
179179
option: Optional
180180
optional: true
181-
expression: {{ `{{if ne (index . "OB_RPC_PORT") ""}}{{.OB_RPC_PORT}}{{else}}2882{{end}}` | toYaml }}
181+
expression: {{ `{{if index . "OB_RPC_PORT"}}{{.OB_RPC_PORT}}{{else}}2882{{end}}` | toYaml }}
182182
- name: SERVICE_PORT
183183
valueFrom:
184184
hostNetworkVarRef:
@@ -188,7 +188,7 @@ vars:
188188
name: http
189189
option: Optional
190190
optional: true
191-
expression: {{ `{{if ne (index . "SERVICE_PORT") ""}}{{.SERVICE_PORT}}{{else}}8088{{end}}` | toYaml }}
191+
expression: {{ `{{if index . "SERVICE_PORT"}}{{.SERVICE_PORT}}{{else}}8088{{end}}` | toYaml }}
192192
- name: MANAGER_PORT
193193
valueFrom:
194194
hostNetworkVarRef:
@@ -198,7 +198,7 @@ vars:
198198
name: http
199199
option: Optional
200200
optional: true
201-
expression: {{ `{{if ne (index . "MANAGER_PORT") ""}}{{.MANAGER_PORT}}{{else}}8089{{end}}` | toYaml }}
201+
expression: {{ `{{if index . "MANAGER_PORT"}}{{.MANAGER_PORT}}{{else}}8089{{end}}` | toYaml }}
202202
- name: COMP_MYSQL_PORT
203203
value: $(OB_SERVICE_PORT)
204204
- name: OB_COMPONENT_NAME

addons/redis/templates/cmpd-redis-cluster.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ spec:
339339
option: Required
340340
- name: SERVICE_PORT
341341
value: "6379"
342-
expression: {{ `{{if ne (index . "REDIS_CLUSTER_HOST_NETWORK_PORT") ""}}{{.REDIS_CLUSTER_HOST_NETWORK_PORT}}{{else}}{{.SERVICE_PORT}}{{end}}` | toYaml }}
342+
expression: {{ `{{if index . "REDIS_CLUSTER_HOST_NETWORK_PORT"}}{{.REDIS_CLUSTER_HOST_NETWORK_PORT}}{{else}}{{.SERVICE_PORT}}{{end}}` | toYaml }}
343343
## the env of redis server port for dbctl to connect to redis cluster server
344344
- name: DBCTL_REDIS_SERVICE_PORT
345345
value: $(SERVICE_PORT)
@@ -355,7 +355,7 @@ spec:
355355
option: Required
356356
- name: CLUSTER_BUS_PORT
357357
value: "16379"
358-
expression: {{ `{{if ne (index . "REDIS_CLUSTER_HOST_NETWORK_BUS_PORT") ""}}{{.REDIS_CLUSTER_HOST_NETWORK_BUS_PORT}}{{else}}{{.CLUSTER_BUS_PORT}}{{end}}` | toYaml }}
358+
expression: {{ `{{if index . "REDIS_CLUSTER_HOST_NETWORK_BUS_PORT"}}{{.REDIS_CLUSTER_HOST_NETWORK_BUS_PORT}}{{else}}{{.CLUSTER_BUS_PORT}}{{end}}` | toYaml }}
359359
{{- if $.Values.enableMetrics }}
360360
## the redis server metrics container host network port when using host network mode, the port will be allocated automatically by KubeBlocks
361361
- name: REDIS_METRICS_HOST_NETWORK_PORT
@@ -369,7 +369,7 @@ spec:
369369
option: Required
370370
- name: REDIS_METRICS_HTTP_PORT
371371
value: "9121"
372-
expression: {{ `{{if ne (index . "REDIS_METRICS_HOST_NETWORK_PORT") ""}}{{.REDIS_METRICS_HOST_NETWORK_PORT}}{{else}}{{.REDIS_METRICS_HTTP_PORT}}{{end}}` | toYaml }}
372+
expression: {{ `{{if index . "REDIS_METRICS_HOST_NETWORK_PORT"}}{{.REDIS_METRICS_HOST_NETWORK_PORT}}{{else}}{{.REDIS_METRICS_HTTP_PORT}}{{end}}` | toYaml }}
373373
## the redis server metrics container host network server port when using host network mode, the port will be allocated automatically by KubeBlocks
374374
- name: REDIS_METRICS_HOST_NETWORK_SERVER_PORT
375375
valueFrom:
@@ -382,7 +382,7 @@ spec:
382382
option: Required
383383
- name: REDIS_METRICS_SERVER_PORT
384384
value: "8888"
385-
expression: {{ `{{if ne (index . "REDIS_METRICS_HOST_NETWORK_SERVER_PORT") ""}}{{.REDIS_METRICS_HOST_NETWORK_SERVER_PORT}}{{else}}{{.REDIS_METRICS_SERVER_PORT}}{{end}}` | toYaml }}
385+
expression: {{ `{{if index . "REDIS_METRICS_HOST_NETWORK_SERVER_PORT"}}{{.REDIS_METRICS_HOST_NETWORK_SERVER_PORT}}{{else}}{{.REDIS_METRICS_SERVER_PORT}}{{end}}` | toYaml }}
386386
## the redis cluster host network port list for all shard pods, the all pods in same shard has the same host network port allocated automatically by KubeBlocks.
387387
## the value format is like "shard-chg:1057,shard-khh:1056,shard-mpg:1053"
388388
- name: REDIS_CLUSTER_ALL_SHARDS_HOST_NETWORK_PORT

addons/redis/templates/cmpd-redis-sentinel.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ spec:
157157
option: Required
158158
- name: SENTINEL_SERVICE_PORT
159159
value: "26379"
160-
expression: {{ `{{if ne (index . "REDIS_SENTINEL_HOST_NETWORK_PORT") ""}}{{.REDIS_SENTINEL_HOST_NETWORK_PORT}}{{else}}{{.SENTINEL_SERVICE_PORT}}{{end}}` | toYaml }}
160+
expression: {{ `{{if index . "REDIS_SENTINEL_HOST_NETWORK_PORT"}}{{.REDIS_SENTINEL_HOST_NETWORK_PORT}}{{else}}{{.SENTINEL_SERVICE_PORT}}{{end}}` | toYaml }}
161161
## the env of redis sentinel server port for dbctl to connect to redis cluster server
162162
- name: DBCTL_REDIS_SENTINEL_SERVICE_PORT
163163
value: $(SENTINEL_SERVICE_PORT)

addons/redis/templates/cmpd-redis.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ spec:
217217
option: Required
218218
- name: SERVICE_PORT
219219
value: "6379"
220-
expression: {{ `{{if ne (index . "REDIS_HOST_NETWORK_PORT") ""}}{{.REDIS_HOST_NETWORK_PORT}}{{else}}{{.SERVICE_PORT}}{{end}}` | toYaml }}
220+
expression: {{ `{{if index . "REDIS_HOST_NETWORK_PORT"}}{{.REDIS_HOST_NETWORK_PORT}}{{else}}{{.SERVICE_PORT}}{{end}}` | toYaml }}
221221
## the env of redis server port for dbctl to connect to redis server
222222
- name: DBCTL_REDIS_SERVICE_PORT
223223
value: $(SERVICE_PORT)
@@ -234,7 +234,7 @@ spec:
234234
option: Required
235235
- name: REDIS_METRICS_HTTP_PORT
236236
value: "9121"
237-
expression: {{ `{{if ne (index . "REDIS_METRICS_HOST_NETWORK_PORT") ""}}{{.REDIS_METRICS_HOST_NETWORK_PORT}}{{else}}{{.REDIS_METRICS_HTTP_PORT}}{{end}}` | toYaml }}
237+
expression: {{ `{{if index . "REDIS_METRICS_HOST_NETWORK_PORT"}}{{.REDIS_METRICS_HOST_NETWORK_PORT}}{{else}}{{.REDIS_METRICS_HTTP_PORT}}{{end}}` | toYaml }}
238238
## the redis server metrics container host network server port when using host network mode, the port will be allocated automatically by KubeBlocks, if not set, the default value is 8888
239239
- name: REDIS_METRICS_HOST_NETWORK_SERVER_PORT
240240
valueFrom:
@@ -247,7 +247,7 @@ spec:
247247
option: Required
248248
- name: REDIS_METRICS_SERVER_PORT
249249
value: "8888"
250-
expression: {{ `{{if ne (index . "REDIS_METRICS_HOST_NETWORK_SERVER_PORT") ""}}{{.REDIS_METRICS_HOST_NETWORK_SERVER_PORT}}{{else}}{{.REDIS_METRICS_SERVER_PORT}}{{end}}` | toYaml }}
250+
expression: {{ `{{if index . "REDIS_METRICS_HOST_NETWORK_SERVER_PORT"}}{{.REDIS_METRICS_HOST_NETWORK_SERVER_PORT}}{{else}}{{.REDIS_METRICS_SERVER_PORT}}{{end}}` | toYaml }}
251251
{{- end }}
252252
## the component name of redis sentinel when redis sentinel is enabled, it's the fullname of redis-sentinel component
253253
- name: SENTINEL_COMPONENT_NAME
@@ -304,7 +304,7 @@ spec:
304304
port:
305305
name: redis-sentinel
306306
option: Required
307-
expression: {{ `{{if ne (index . "SENTINEL_SERVICE_PORT") ""}}{{.SENTINEL_SERVICE_PORT}}{{else}}26379{{end}}` | toYaml }}
307+
expression: {{ `{{if index . "SENTINEL_SERVICE_PORT"}}{{.SENTINEL_SERVICE_PORT}}{{else}}26379{{end}}` | toYaml }}
308308
- name: PHY_MEMORY
309309
valueFrom:
310310
resourceVarRef:

0 commit comments

Comments
 (0)