123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- {{/*
- Create a default fully qualified app name.
- We truncate at 63 chars because some Kubernetes name fields are limited to
- this (by the DNS naming spec). If release name contains chart name it will
- be used as a full name.
- */}}
- {{- define "seaweedfs.fullname" -}}
- {{- if .Values.fullnameOverride -}}
- {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
- {{- else -}}
- {{- $name := default .Chart.Name .Values.nameOverride -}}
- {{- if contains $name .Release.Name -}}
- {{- .Release.Name | trunc 63 | trimSuffix "-" -}}
- {{- else -}}
- {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
- {{/*
- Create chart name and version as used by the chart label.
- */}}
- {{- define "seaweedfs.chart" -}}
- {{- printf "%s-helm" .Chart.Name | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
- {{- end -}}
- {{/*
- Expand the name of the chart.
- */}}
- {{- define "seaweedfs.name" -}}
- {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
- {{- end -}}
- {{/*
- Inject extra environment vars in the format key:value, if populated
- */}}
- {{- define "seaweedfs.extraEnvironmentVars" -}}
- {{- if .extraEnvironmentVars -}}
- {{- range $key, $value := .extraEnvironmentVars }}
- - name: {{ $key }}
- value: {{ $value | quote }}
- {{- end -}}
- {{- end -}}
- {{- end -}}
- {{/* Return the proper filer image */}}
- {{- define "filer.image" -}}
- {{- if .Values.filer.imageOverride -}}
- {{- $imageOverride := .Values.filer.imageOverride -}}
- {{- printf "%s" $imageOverride -}}
- {{- else -}}
- {{- $registryName := default .Values.image.registry .Values.global.localRegistry | toString -}}
- {{- $repositoryName := .Values.image.repository | toString -}}
- {{- $name := .Values.global.imageName | toString -}}
- {{- $tag := .Chart.AppVersion | toString -}}
- {{- printf "%s%s%s:%s" $registryName $repositoryName $name $tag -}}
- {{- end -}}
- {{- end -}}
- {{/* Return the proper dbSchema image */}}
- {{- define "filer.dbSchema.image" -}}
- {{- if .Values.filer.dbSchema.imageOverride -}}
- {{- $imageOverride := .Values.filer.dbSchema.imageOverride -}}
- {{- printf "%s" $imageOverride -}}
- {{- else -}}
- {{- $registryName := default .Values.global.registry .Values.global.localRegistry | toString -}}
- {{- $repositoryName := .Values.global.repository | toString -}}
- {{- $name := .Values.filer.dbSchema.imageName | toString -}}
- {{- $tag := .Values.filer.dbSchema.imageTag | toString -}}
- {{- printf "%s%s%s:%s" $registryName $repositoryName $name $tag -}}
- {{- end -}}
- {{- end -}}
- {{/* Return the proper master image */}}
- {{- define "master.image" -}}
- {{- if .Values.master.imageOverride -}}
- {{- $imageOverride := .Values.master.imageOverride -}}
- {{- printf "%s" $imageOverride -}}
- {{- else -}}
- {{- $registryName := default .Values.image.registry .Values.global.localRegistry | toString -}}
- {{- $repositoryName := .Values.image.repository | toString -}}
- {{- $name := .Values.global.imageName | toString -}}
- {{- $tag := .Chart.AppVersion | toString -}}
- {{- printf "%s%s%s:%s" $registryName $repositoryName $name $tag -}}
- {{- end -}}
- {{- end -}}
- {{/* Return the proper s3 image */}}
- {{- define "s3.image" -}}
- {{- if .Values.s3.imageOverride -}}
- {{- $imageOverride := .Values.s3.imageOverride -}}
- {{- printf "%s" $imageOverride -}}
- {{- else -}}
- {{- $registryName := default .Values.image.registry .Values.global.localRegistry | toString -}}
- {{- $repositoryName := .Values.image.repository | toString -}}
- {{- $name := .Values.global.imageName | toString -}}
- {{- $tag := .Chart.AppVersion | toString -}}
- {{- printf "%s%s%s:%s" $registryName $repositoryName $name $tag -}}
- {{- end -}}
- {{- end -}}
- {{/* Return the proper volume image */}}
- {{- define "volume.image" -}}
- {{- if .Values.volume.imageOverride -}}
- {{- $imageOverride := .Values.volume.imageOverride -}}
- {{- printf "%s" $imageOverride -}}
- {{- else -}}
- {{- $registryName := default .Values.image.registry .Values.global.localRegistry | toString -}}
- {{- $repositoryName := .Values.image.repository | toString -}}
- {{- $name := .Values.global.imageName | toString -}}
- {{- $tag := .Chart.AppVersion | toString -}}
- {{- printf "%s%s%s:%s" $registryName $repositoryName $name $tag -}}
- {{- end -}}
- {{- end -}}
- {{/* check if any Volume PVC exists */}}
- {{- define "volume.pvc_exists" -}}
- {{- if or (or (eq .Values.volume.data.type "persistentVolumeClaim") (and (eq .Values.volume.idx.type "persistentVolumeClaim") .Values.volume.dir_idx )) (eq .Values.volume.logs.type "persistentVolumeClaim") -}}
- {{- printf "true" -}}
- {{- else -}}
- {{- printf "false" -}}
- {{- end -}}
- {{- end -}}
- {{/* check if any Volume HostPath exists */}}
- {{- define "volume.hostpath_exists" -}}
- {{- if or (or (eq .Values.volume.data.type "hostPath") (and (eq .Values.volume.idx.type "hostPath") .Values.volume.dir_idx )) (eq .Values.volume.logs.type "hostPath") -}}
- {{- printf "true" -}}
- {{- else -}}
- {{- if or .Values.global.enableSecurity .Values.volume.extraVolumes -}}
- {{- printf "true" -}}
- {{- else -}}
- {{- printf "false" -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
- {{/* check if any Filer PVC exists */}}
- {{- define "filer.pvc_exists" -}}
- {{- if or (eq .Values.filer.data.type "persistentVolumeClaim") (eq .Values.filer.logs.type "persistentVolumeClaim") -}}
- {{- printf "true" -}}
- {{- else -}}
- {{- printf "false" -}}
- {{- end -}}
- {{- end -}}
- {{/* check if any Filer HostPath exists */}}
- {{- define "filer.hostpath_exists" -}}
- {{- if or (eq .Values.filer.data.type "hostPath") (eq .Values.filer.logs.type "hostPath") -}}
- {{- printf "true" -}}
- {{- else -}}
- {{- printf "false" -}}
- {{- end -}}
- {{- end -}}
- {{/* check if any Master PVC exists */}}
- {{- define "master.pvc_exists" -}}
- {{- if or (eq .Values.master.data.type "persistentVolumeClaim") (eq .Values.master.logs.type "persistentVolumeClaim") -}}
- {{- printf "true" -}}
- {{- else -}}
- {{- printf "false" -}}
- {{- end -}}
- {{- end -}}
- {{/* check if any Master HostPath exists */}}
- {{- define "master.hostpath_exists" -}}
- {{- if or (eq .Values.master.data.type "hostPath") (eq .Values.master.logs.type "hostPath") -}}
- {{- printf "true" -}}
- {{- else -}}
- {{- if or .Values.global.enableSecurity .Values.volume.extraVolumes -}}
- {{- printf "true" -}}
- {{- else -}}
- {{- printf "false" -}}
- {{- end -}}
- {{- end -}}
- {{- end -}}
- {{/* check if any InitContainers exist for Volumes */}}
- {{- define "volume.initContainers_exists" -}}
- {{- if or (not (empty .Values.volume.dir_idx )) (not (empty .Values.volume.initContainers )) -}}
- {{- printf "true" -}}
- {{- else -}}
- {{- printf "false" -}}
- {{- end -}}
- {{- end -}}
|