Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: separate image and tag in helm values #4216

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions charts/fluid/fluid/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,34 @@ Create the name of the service account to use
{{- end -}}
{{- end -}}

{{/* assemble images for fluid control-plane images */}}
{{- define "fluid.controlplane.imageTransform" -}}
{{- $imagePrefix := index . 0 -}}
{{- $imageName := index . 1 -}}
{{- $imageTag := index . 2 -}}

{{- /* If any value is empty, return an error message */ -}}
{{- if or (empty $imagePrefix) (empty $imageName) (empty $imageTag) -}}
{{- fail "Error: imagePrefix, imageName, and imageTag must all be defined and non-empty." -}}
{{- end -}}

{{- printf "%s/%s:%s" $imagePrefix $imageName $imageTag -}}
{{- end -}}

{{/* assemble images for runtime images */}}
{{- define "fluid.runtime.imageTransform" -}}
{{- $imagePrefix := index . 0 -}}
{{- $imageName := index . 1 -}}
{{- $imageTag := index . 2 -}}

{{- /* If any value is empty, return an error message */ -}}
{{- if or (empty $imagePrefix) (empty $imageName) (empty $imageTag) -}}
{{- fail "Error: imagePrefix, imageName, and imageTag must all be defined and non-empty." -}}
{{- end -}}

{{- printf "%s/%s:%s" $imagePrefix $imageName $imageTag -}}
{{- end -}}


{{/*
Check if feature gate DataflowAffinity is enabled in the featureGates.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
{{- end }}
#hostNetwork: true
containers:
- image: "{{ .Values.runtime.alluxio.controller.image }}"
- image: {{ include "fluid.controlplane.imageTransform" (list .Values.runtime.alluxio.controller.imagePrefix .Values.runtime.alluxio.controller.imageName .Values.runtime.alluxio.controller.imageTag) }}
name: manager
command: ["alluxioruntime-controller", "start"]
args:
Expand All @@ -60,17 +60,17 @@ spec:
- name: FLUID_WORKDIR
value: {{ .Values.workdir | quote }}
{{- end }}
{{- if .Values.runtime.alluxio.init.image }}
{{- if .Values.runtime.alluxio.init.imageName }}
- name: DEFAULT_INIT_IMAGE_ENV
value: {{ .Values.runtime.alluxio.init.image | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.alluxio.init.imagePrefix .Values.runtime.alluxio.init.imageName .Values.runtime.alluxio.init.imageTag) }}
{{- end }}
{{- if .Values.runtime.alluxio.runtime.image }}
{{- if .Values.runtime.alluxio.runtime.imageName }}
- name: ALLUXIO_RUNTIME_IMAGE_ENV
value: {{ .Values.runtime.alluxio.runtime.image | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.alluxio.runtime.imagePrefix .Values.runtime.alluxio.runtime.imageName .Values.runtime.alluxio.runtime.imageTag) }}
{{- end }}
{{- if .Values.runtime.alluxio.fuse.image }}
{{- if .Values.runtime.alluxio.fuse.imageName }}
- name: ALLUXIO_FUSE_IMAGE_ENV
value: {{ .Values.runtime.alluxio.fuse.image | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.alluxio.fuse.imagePrefix .Values.runtime.alluxio.fuse.imageName .Values.runtime.alluxio.fuse.imageTag) }}
{{- end }}
{{- if .Values.runtime.mountRoot }}
- name: MOUNT_ROOT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
{{- end }}
#hostNetwork: true
containers:
- image: "{{ .Values.dataset.controller.image }}"
- image: {{ include "fluid.controlplane.imageTransform" (list .Values.dataset.controller.imagePrefix .Values.dataset.controller.imageName .Values.dataset.controller.imageTag) }}
name: manager
command: ["dataset-controller", "start"]
args:
Expand All @@ -59,9 +59,9 @@ spec:
- name: JINDO_ENGINE_TYPE
value: {{ .Values.runtime.jindo.engine | quote }}
{{- end }}
{{- if .Values.runtime.alluxio.runtime.image }}
{{- if .Values.runtime.alluxio.runtime.imageName }}
- name: ALLUXIO_RUNTIME_IMAGE_ENV
value: {{ .Values.runtime.alluxio.runtime.image | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.alluxio.runtime.imagePrefix .Values.runtime.alluxio.runtime.imageName .Values.runtime.alluxio.runtime.imageTag) }}
{{- end }}
{{- if .Values.image.imagePullSecrets }}
- name: IMAGE_PULL_SECRETS
Expand Down
20 changes: 10 additions & 10 deletions charts/fluid/fluid/templates/controller/efcruntime_controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
{{- end }}
#hostNetwork: true
containers:
- image: "{{ .Values.runtime.efc.controller.image }}"
- image: {{ include "fluid.controlplane.imageTransform" (list .Values.runtime.efc.controller.imagePrefix .Values.runtime.efc.controller.imageName .Values.runtime.efc.controller.imageTag) }}
imagePullPolicy: {{ .Values.runtime.efc.controller.imagePullPolicy }}
name: manager
args:
Expand All @@ -66,23 +66,23 @@ spec:
- name: FLUID_SYNC_RETRY_DURATION
value: {{ .Values.runtime.syncRetryDuration | quote }}
{{- end }}
{{- if .Values.runtime.efc.init.image }}
{{- if .Values.runtime.efc.init.imageName }}
- name: EFC_INIT_FUSE_IMAGE_ENV
value: {{ .Values.runtime.efc.init.image | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.efc.init.imagePrefix .Values.runtime.efc.init.imageName .Values.runtime.efc.init.imageTag) }}
{{- end }}
{{- if .Values.runtime.efc.master.image }}
{{- if .Values.runtime.efc.master.imageName }}
- name: EFC_MASTER_IMAGE_ENV
value: {{ .Values.runtime.efc.master.image | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.efc.master.imagePrefix .Values.runtime.efc.master.imageName .Values.runtime.efc.master.imageTag) }}
{{- end }}
{{- if .Values.runtime.efc.worker.image }}
{{- if .Values.runtime.efc.worker.imageName }}
- name: EFC_WORKER_IMAGE_ENV
value: {{ .Values.runtime.efc.worker.image | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.efc.worker.imagePrefix .Values.runtime.efc.worker.imageName .Values.runtime.efc.worker.imageTag) }}
{{- end }}
{{- if .Values.runtime.efc.fuse.image }}
{{- if .Values.runtime.efc.fuse.imageName }}
- name: EFC_FUSE_IMAGE_ENV
value: {{ .Values.runtime.efc.fuse.image | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.efc.fuse.imagePrefix .Values.runtime.efc.fuse.imageName .Values.runtime.efc.fuse.imageTag) }}
- name: EFC_SESSMGR_IMAGE_ENV
value: {{ .Values.runtime.efc.fuse.image | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.efc.fuse.imagePrefix .Values.runtime.efc.fuse.imageName .Values.runtime.efc.fuse.imageTag) }}
{{- end }}
- name: HELM_DRIVER
value: {{ template "fluid.helmDriver" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
{{- end }}
#hostNetwork: true
containers:
- image: "{{ .Values.fluidapp.controller.image }}"
- image: {{ include "fluid.controlplane.imageTransform" (list .Values.fluidapp.controller.imagePrefix .Values.fluidapp.controller.imageName .Values.fluidapp.controller.imageTag) }}
name: manager
command: ["fluidapp-controller", "start"]
args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
{{- end }}
#hostNetwork: true
containers:
- image: "{{ .Values.runtime.goosefs.controller.image }}"
- image: {{ include "fluid.controlplane.imageTransform" (list .Values.runtime.goosefs.controller.imagePrefix .Values.runtime.goosefs.controller.imageName .Values.runtime.goosefs.controller.imageTag) }}
imagePullPolicy: Always
name: manager
command: ["goosefsruntime-controller", "start"]
Expand All @@ -61,17 +61,17 @@ spec:
- name: FLUID_WORKDIR
value: {{ .Values.workdir | quote }}
{{- end }}
{{- if .Values.runtime.goosefs.init.image }}
{{- if .Values.runtime.goosefs.init.imageName }}
- name: DEFAULT_INIT_IMAGE_ENV
value: {{ .Values.runtime.goosefs.init.image | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.goosefs.init.imagePrefix .Values.runtime.goosefs.init.imageName .Values.runtime.goosefs.init.imageTag) }}
{{- end }}
{{- if .Values.runtime.goosefs.runtime.image }}
{{- if .Values.runtime.goosefs.runtime.imageName }}
- name: GOOSEFS_RUNTIME_IMAGE_ENV
value: {{ .Values.runtime.goosefs.runtime.image | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.goosefs.runtime.imagePrefix .Values.runtime.goosefs.runtime.imageName .Values.runtime.goosefs.runtime.imageTag) }}
{{- end }}
{{- if .Values.runtime.goosefs.fuse.image }}
{{- if .Values.runtime.goosefs.fuse.imageName }}
- name: GOOSEFS_FUSE_IMAGE_ENV
value: {{ .Values.runtime.goosefs.fuse.image | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.goosefs.fuse.imagePrefix .Values.runtime.goosefs.fuse.imageName .Values.runtime.goosefs.fuse.imageTag) }}
{{- end }}
{{- if .Values.runtime.mountRoot }}
- name: MOUNT_ROOT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ spec:
{{ toYaml .Values.runtime.jindo.tolerations | indent 6 }}
{{- end }}
containers:
- image: {{ .Values.runtime.jindo.controller.image | quote }}
- image: {{ include "fluid.controlplane.imageTransform" (list .Values.runtime.jindo.controller.imagePrefix .Values.runtime.jindo.controller.imageName .Values.runtime.jindo.controller.imageTag) }}
name: manager
command: ["jindoruntime-controller", "start"]
args:
Expand All @@ -63,17 +63,17 @@ spec:
- name: MOUNT_ROOT
value: {{ .Values.runtime.mountRoot | quote }}
{{- end }}
{{- if .Values.runtime.jindo.smartdata.image }}
{{- if .Values.runtime.jindo.smartdata.imageName }}
- name: JINDO_SMARTDATA_IMAGE_ENV
value: {{ .Values.runtime.jindo.smartdata.image | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.jindo.smartdata.imagePrefix .Values.runtime.jindo.smartdata.imageName .Values.runtime.jindo.smartdata.imageTag) }}
{{- end }}
{{- if .Values.runtime.jindo.fuse.image }}
{{- if .Values.runtime.jindo.fuse.imageName }}
- name: JINDO_FUSE_IMAGE_ENV
value: {{ .Values.runtime.jindo.fuse.image | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.jindo.fuse.imagePrefix .Values.runtime.jindo.fuse.imageName .Values.runtime.jindo.fuse.imageTag) }}
{{- end }}
{{- if .Values.runtime.jindo.init.image }}
{{- if .Values.runtime.jindo.init.imageName }}
- name: DEFAULT_INIT_IMAGE_ENV
value: {{ .Values.runtime.jindo.init.image | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.jindo.init.imagePrefix .Values.runtime.jindo.init.imageName .Values.runtime.jindo.init.imageTag) }}
{{- end }}
{{- if .Values.runtime.jindo.init.portCheck }}
- name: INIT_PORT_CHECK_ENABLED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
{{- end }}
#hostNetwork: true
containers:
- image: "{{ .Values.runtime.juicefs.controller.image }}"
- image: {{ include "fluid.controlplane.imageTransform" (list .Values.runtime.juicefs.controller.imagePrefix .Values.runtime.juicefs.controller.imageName .Values.runtime.juicefs.controller.imageTag) }}
name: manager
args:
- --development=false
Expand All @@ -64,13 +64,13 @@ spec:
{{- end }}
value: {{ join "," $secretList | quote }}
{{- end }}
{{- if .Values.runtime.juicefs.fuse.ceimage }}
{{- if .Values.runtime.juicefs.fuse.ceimageName }}
- name: JUICEFS_CE_IMAGE_ENV
value: {{ .Values.runtime.juicefs.fuse.ceimage | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.juicefs.fuse.ceimagePrefix .Values.runtime.juicefs.fuse.ceimageName .Values.runtime.juicefs.fuse.ceimageTag) }}
{{- end }}
{{- if .Values.runtime.juicefs.fuse.eeimage }}
{{- if .Values.runtime.juicefs.fuse.eeimageName }}
- name: JUICEFS_EE_IMAGE_ENV
value: {{ .Values.runtime.juicefs.fuse.eeimage | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.juicefs.fuse.eeimagePrefix .Values.runtime.juicefs.fuse.eeimageName .Values.runtime.juicefs.fuse.eeimageTag) }}
{{- end }}
{{- if .Values.runtime.mountRoot }}
- name: MOUNT_ROOT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
{{- end }}
#hostNetwork: true
containers:
- image: "{{ .Values.runtime.thin.controller.image }}"
- image: {{ include "fluid.controlplane.imageTransform" (list .Values.runtime.thin.controller.imagePrefix .Values.runtime.thin.controller.imageName .Values.runtime.thin.controller.imageTag) }}
name: manager
args:
- --development=false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ spec:
{{ toYaml .Values.runtime.vineyard.tolerations | indent 6 }}
{{- end }}
containers:
- image: {{ .Values.runtime.vineyard.controller.image | quote }}
- image: {{ include "fluid.controlplane.imageTransform" (list .Values.runtime.vineyard.controller.imagePrefix .Values.runtime.vineyard.controller.imageName .Values.runtime.vineyard.controller.imageTag) }}
name: manager
command: ["vineyardruntime-controller", "start"]
args:
Expand All @@ -61,17 +61,17 @@ spec:
- name: MOUNT_ROOT
value: {{ .Values.runtime.mountRoot | quote }}
{{- end }}
{{- if .Values.runtime.vineyard.master.image }}
{{- if .Values.runtime.vineyard.master.imageName }}
- name: VINEYARD_MASTER_IMAGE_ENV
value: {{ .Values.runtime.vineyard.master.image | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.vineyard.master.imagePrefix .Values.runtime.vineyard.master.imageName .Values.runtime.vineyard.master.imageTag) }}
{{- end }}
{{- if .Values.runtime.vineyard.worker.image }}
{{- if .Values.runtime.vineyard.worker.imageName }}
- name: VINEYARD_WORKER_IMAGE_ENV
value: {{ .Values.runtime.vineyard.worker.image | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.vineyard.worker.imagePrefix .Values.runtime.vineyard.worker.imageName .Values.runtime.vineyard.worker.imageTag) }}
{{- end }}
{{- if .Values.runtime.vineyard.fuse.image }}
{{- if .Values.runtime.vineyard.fuse.imageName }}
- name: VINEYARD_FUSE_IMAGE_ENV
value: {{ .Values.runtime.vineyard.fuse.image | quote }}
value: {{ include "fluid.runtime.imageTransform" (list .Values.runtime.vineyard.fuse.imagePrefix .Values.runtime.vineyard.fuse.imageName .Values.runtime.vineyard.fuse.imageTag) }}
{{- end }}
{{- if .Values.runtime.syncRetryDuration }}
- name: FLUID_SYNC_RETRY_DURATION
Expand Down
4 changes: 2 additions & 2 deletions charts/fluid/fluid/templates/csi/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
- virtual-kubelet
containers:
- name: node-driver-registrar
image: "{{ .Values.csi.registrar.image }}"
image: {{ include "fluid.controlplane.imageTransform" (list .Values.csi.registrar.imagePrefix .Values.csi.registrar.imageName .Values.csi.registrar.imageTag) }}
args:
- --v=5
- --csi-address={{ .Values.csi.kubelet.rootDir }}/csi-plugins/fuse.csi.fluid.io/csi.sock
Expand All @@ -63,7 +63,7 @@ spec:
capabilities:
add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true
image: "{{ .Values.csi.plugins.image }}"
image: {{ include "fluid.controlplane.imageTransform" (list .Values.csi.plugins.imagePrefix .Values.csi.plugins.imageName .Values.csi.plugins.imageTag) }}
command: ["/usr/local/bin/entrypoint.sh"]
args:
- "--nodeid=$(NODE_ID)"
Expand Down
2 changes: 1 addition & 1 deletion charts/fluid/fluid/templates/upgrade/crd-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
serviceAccountName: fluid-crds-upgrade
containers:
- name: fluid-crds-upgrade
image: {{ .Values.crdUpgrade.image }}
image: {{ include "fluid.controlplane.imageTransform" (list .Values.crdUpgrade.imagePrefix .Values.crdUpgrade.imageName .Values.crdUpgrade.imageTag) }}
command: ["bash", "/fluid/upgrade-crds.sh"]
restartPolicy: OnFailure
---
Expand Down
2 changes: 1 addition & 1 deletion charts/fluid/fluid/templates/webhook/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
{{- end }}
serviceAccountName: fluid-webhook
containers:
- image: {{ .Values.webhook.image | quote }}
- image: {{ include "fluid.controlplane.imageTransform" (list .Values.webhook.imagePrefix .Values.webhook.imageName .Values.webhook.imageTag) }}
name: manager
command: ["fluid-webhook", "start"]
args:
Expand Down
Loading
Loading