Files
charts/bitnami/gitlab-runner/templates/_helpers.tpl
Javier J. Salmerón García 21a3ab7fee [bitnami/gitlab-runner] feat: 🎉 Add chart (#32513)
* [bitnami/gitlab-runner] feat: 🎉 Add chart

Signed-off-by: Javier J. Salmerón García <javier.salmeron@broadcom.com>

* Update CHANGELOG.md

Signed-off-by: Bitnami Bot <bitnami.bot@broadcom.com>

* feat:  Add HPA and VPA

Signed-off-by: Javier J. Salmerón García <javier.salmeron@broadcom.com>

* fix: 🐛 Set correct vib-verify

Signed-off-by: Javier J. Salmerón García <javier.salmeron@broadcom.com>

* Update CHANGELOG.md

Signed-off-by: Bitnami Bot <bitnami.bot@broadcom.com>

* chore: ♻️ Apply suggestions from code review

Signed-off-by: Javier J. Salmerón García <javier.salmeron@broadcom.com>

* chore: ♻️ Apply suggestions from code review

Signed-off-by: Javier J. Salmerón García <javier.salmeron@broadcom.com>

* chore: 🔧 Disable kubescape

Signed-off-by: Javier J. Salmerón García <javier.salmeron@broadcom.com>

* chore: 🔧 Disable validation

Signed-off-by: Javier J. Salmerón García <javier.salmeron@broadcom.com>

* fix: 🐛 Use proper configmap

Signed-off-by: Javier J. Salmerón García <javier.salmeron@broadcom.com>

---------

Signed-off-by: Javier J. Salmerón García <javier.salmeron@broadcom.com>
Signed-off-by: Bitnami Bot <bitnami.bot@broadcom.com>
Co-authored-by: Bitnami Bot <bitnami.bot@broadcom.com>
2025-03-28 13:50:16 +01:00

99 lines
2.8 KiB
Smarty

{{/*
Copyright Broadcom, Inc. All Rights Reserved.
SPDX-License-Identifier: APACHE-2.0
*/}}
{{/* vim: set filetype=mustache: */}}
{{/*
Create the name of the service account to use
*/}}
{{- define "gitlab-runner.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "common.names.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Return the proper gitlab-runner image name
*/}}
{{- define "gitlab-runner.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }}
{{- end -}}
{{/*
Return the proper gitlab-runner image name
*/}}
{{- define "gitlab-runner.session-server.fullname" -}}
{{ printf "%s-session-server" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
{{- end -}}
{{/*
Return the proper Docker Image Registry Secret Names
*/}}
{{- define "gitlab-runner.imagePullSecrets" -}}
{{- include "common.images.renderPullSecrets" (dict "images" (list .Values.image ) "context" $) -}}
{{- end -}}
{{/*
Name of the Runner Secret
*/}}
{{- define "gitlab-runner.secretName" -}}
{{- if .Values.existingSecret -}}
{{- include "common.tplvalues.render" (dict "value" .Values.existingSecret "context" $) -}}
{{- else -}}
{{- include "common.names.fullname" . -}}
{{- end -}}
{{- end -}}
{{/*
Name of the Runner ConfigMap
*/}}
{{- define "gitlab-runner.configmapName" -}}
{{- if .Values.existingConfigMap -}}
{{- include "common.tplvalues.render" (dict "value" .Values.existingConfigMap "context" $) -}}
{{- else -}}
{{- include "common.names.fullname" . -}}
{{- end -}}
{{- end -}}
{{/*
Return true if the server can be deployed
*/}}
{{- define "gitlab-runner.canDeploy" -}}
{{- if and .Values.gitlabUrl (coalesce .Values.runnerToken .Values.existingSecret) -}}
{{- true -}}
{{- end -}}
{{- end -}}
{{/*
Compile all warnings into a single message, and call fail.
*/}}
{{- define "gitlab-runner.validateValues" -}}
{{- $messages := list -}}
{{- $messages := append $messages (include "gitlab-runner.validateValues.sessionServer" .) -}}
{{- $messages := without $messages "" -}}
{{- $message := join "\n" $messages -}}
{{- if $message -}}
{{- printf "\nVALUES VALIDATION:\n%s" $message | fail -}}
{{- end -}}
{{- end -}}
{{/* Validate values of gitlab-runner - Session server configuration */}}
{{- define "gitlab-runner.validateValues.sessionServer" -}}
{{- if and .Values.sessionServer.enabled (gt (.Values.replicaCount | int) 1) -}}
gitlab-runner: Incorrect Session Server configuration
When enabling the session server the number of replicas must be 1
{{- end -}}
{{- end -}}
{{/*
Check if there are rolling tags in the images
*/}}
{{- define "gitlab-runner.checkRollingTags" -}}
{{- include "common.warnings.rollingTag" .Values.image }}
{{- end -}}