add global values support (#322) All checks were successful continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: gitea/helm-chart#322 Reviewed-by: luhahn <luhahn@noreply.gitea.io> Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.io> Co-authored-by: cnfatal <cnfatal@noreply.gitea.io> Co-committed-by: cnfatal <cnfatal@noreply.gitea.io>
This commit was merged in pull request #322.
This commit is contained in:
@@ -35,10 +35,40 @@ Create chart name and version as used by the chart label. | ||||
Create image name and tag used by the deployment. | ||||
*/}} | ||||
{{- define "gitea.image" -}} | ||||
{{- $registry := .Values.global.imageRegistry | default .Values.image.registry -}} | ||||
{{- $name := .Values.image.repository -}} | ||||
{{- $tag := .Values.image.tag | default .Chart.AppVersion -}} | ||||
{{- $rootless := ternary "-rootless" "" (.Values.image.rootless) -}} | ||||
{{- printf "%s:%s%s" $name $tag $rootless -}} | ||||
{{- if $registry -}} | ||||
{{- printf "%s/%s:%s%s" $registry $name $tag $rootless -}} | ||||
{{- else -}} | ||||
{{- printf "%s:%s%s" $name $tag $rootless -}} | ||||
{{- end -}} | ||||
{{- end -}} | ||||
| ||||
{{/* | ||||
Docker Image Registry Secret Names evaluating values as templates | ||||
*/}} | ||||
{{- define "gitea.images.pullSecrets" -}} | ||||
{{- $pullSecrets := .Values.imagePullSecrets -}} | ||||
{{- range .Values.global.imagePullSecrets -}} | ||||
{{- $pullSecrets = append $pullSecrets (dict "name" .) -}} | ||||
{{- end -}} | ||||
{{- if (not (empty $pullSecrets)) }} | ||||
imagePullSecrets: | ||||
{{ toYaml $pullSecrets }} | ||||
{{- end }} | ||||
{{- end -}} | ||||
| ||||
| ||||
{{/* | ||||
Storage Class | ||||
*/}} | ||||
{{- define "gitea.persistence.storageClass" -}} | ||||
{{- $storageClass := .Values.global.storageClass | default .Values.persistence.storageClass }} | ||||
{{- if $storageClass }} | ||||
storageClassName: {{ $storageClass | quote }} | ||||
{{- end }} | ||||
{{- end -}} | ||||
| ||||
{{/* | ||||
| ||||
@@ -39,10 +39,7 @@ spec: | ||||
{{- if .Values.schedulerName }} | ||||
schedulerName: "{{ .Values.schedulerName }}" | ||||
{{- end }} | ||||
{{- with .Values.imagePullSecrets }} | ||||
imagePullSecrets: | ||||
{{- toYaml . | nindent 8 }} | ||||
{{- end }} | ||||
{{- include "gitea.images.pullSecrets" . | nindent 6 }} | ||||
securityContext: | ||||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||||
initContainers: | ||||
@@ -342,9 +339,7 @@ spec: | ||||
{{- range .Values.persistence.accessModes }} | ||||
- {{ . | quote }} | ||||
{{- end }} | ||||
{{- if .Values.persistence.storageClass }} | ||||
storageClassName: {{ .Values.persistence.storageClass | quote }} | ||||
{{- end }} | ||||
{{- include "gitea.persistence.storageClass" . | indent 8 }} | ||||
resources: | ||||
requests: | ||||
storage: {{ .Values.persistence.size | quote }} | ||||
| ||||
Reference in New Issue
Block a user