From 21d12a386a4237f7fdf1bb5351ce33781402b3e0 Mon Sep 17 00:00:00 2001 From: xiaohu <564134281@qq.com> Date: Tue, 7 Sep 2021 19:34:19 +0800 Subject: [PATCH] =?UTF-8?q?feat(xpack):=20=20=E6=9B=B4=E6=96=B0xpack?= =?UTF-8?q?=E9=95=9C=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/_images.tpl | 52 ++++++++++++++++--------- templates/omnidb/deployment-omnidb.yaml | 2 +- templates/xrdp/deployment-xrdp.yaml | 2 +- 3 files changed, 35 insertions(+), 21 deletions(-) diff --git a/templates/_images.tpl b/templates/_images.tpl index d355ded..4beb586 100644 --- a/templates/_images.tpl +++ b/templates/_images.tpl @@ -7,9 +7,9 @@ Return the proper image name {{- $repositoryName := .imageRoot.repository -}} {{- $tag := .imageRoot.tag | toString -}} {{- if .global }} - {{- if .global.imageRegistry }} - {{- $registryName = .global.imageRegistry -}} - {{- end -}} +{{- if .global.imageRegistry }} +{{- $registryName = .global.imageRegistry -}} +{{- end -}} {{- end -}} {{- if $registryName }} {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} @@ -47,29 +47,43 @@ Return the proper JumpServer lion image name {{- include "common.images.image" ( dict "imageRoot" .Values.lion.image "global" .Values.global ) -}} {{- end -}} +{{/* +Return the proper JumpServer xrdp image name +*/}} +{{- define "jumpserver.xrdpImage" -}} +{{- include "common.images.image" ( dict "imageRoot" .Values.xrdp.image "global" .Values.global ) -}} +{{- end -}} + +{{/* +Return the proper JumpServer omnidb image name +*/}} +{{- define "jumpserver.omnidbImage" -}} +{{- include "common.images.image" ( dict "imageRoot" .Values.omnidb.image "global" .Values.global ) -}} +{{- end -}} + {{/* Return the proper Docker Image Registry Secret Names (deprecated: use common.images.renderPullSecrets instead) {{ include "common.images.pullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "global" .Values.global) }} */}} {{- define "common.images.pullSecrets" -}} - {{- $pullSecrets := list }} +{{- $pullSecrets := list }} - {{- if .global }} - {{- range .global.imagePullSecrets -}} - {{- $pullSecrets = append $pullSecrets . -}} - {{- end -}} - {{- end -}} +{{- if .global }} +{{- range .global.imagePullSecrets -}} +{{- $pullSecrets = append $pullSecrets . -}} +{{- end -}} +{{- end -}} - {{- range .images -}} - {{- range .pullSecrets -}} - {{- $pullSecrets = append $pullSecrets . -}} - {{- end -}} - {{- end -}} +{{- range .images -}} +{{- range .pullSecrets -}} +{{- $pullSecrets = append $pullSecrets . -}} +{{- end -}} +{{- end -}} - {{- if (not (empty $pullSecrets)) }} +{{- if (not (empty $pullSecrets)) }} imagePullSecrets: - {{- range $pullSecrets }} - - name: {{ . }} - {{- end }} - {{- end }} +{{- range $pullSecrets }} +- name: {{ . }} +{{- end }} +{{- end }} {{- end -}} \ No newline at end of file diff --git a/templates/omnidb/deployment-omnidb.yaml b/templates/omnidb/deployment-omnidb.yaml index 94dc103..65c2bc7 100644 --- a/templates/omnidb/deployment-omnidb.yaml +++ b/templates/omnidb/deployment-omnidb.yaml @@ -2,7 +2,7 @@ {{- with .Values.omnidb }} {{- $fullName := printf "%s-%s" (include "jumpserver.fullname" $) "jms-omnidb" }} {{- $containerName := "jms-omnidb" }} -{{- $image := printf "%s" (include "jumpserver.omnidbImage" $) }} +{{- $image := printf "%s:%s:%s" .image.registry .image.repository .image.tag }} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/templates/xrdp/deployment-xrdp.yaml b/templates/xrdp/deployment-xrdp.yaml index e03fe27..89f8fd3 100644 --- a/templates/xrdp/deployment-xrdp.yaml +++ b/templates/xrdp/deployment-xrdp.yaml @@ -2,7 +2,7 @@ {{- with .Values.xrdp }} {{- $fullName := printf "%s-%s" (include "jumpserver.fullname" $) "jms-xrdp" }} {{- $containerName := "jms-xrdp" }} -{{- $image := printf "%s" (include "jumpserver.xrdpImage" $) }} +{{- $image := printf "%s:%s:%s" .image.registry .image.repository .image.tag }} apiVersion: apps/v1 kind: Deployment metadata: