{{/* If the Container Registry metadata database is enabled, note it is not production ready */}}
{{- if eq .Values.registry.database.enabled true }}
WARNING: The Container Registry metadata database has been enabled. Please note that it is an experimental feature and must not be used in production.
{{- end }}

{{/* If the Container Registry filesystem metadata is disabled, note it is not production ready */}}
{{- if eq true .Values.registry.migration.disablemirrorfs }}
WARNING: The Container Registry filesystem metadata has been disabled. Please note that it is an experimental feature and must not be used in production.
{{- end }}

{{/* If Praefect enabled, note it is not production ready */}}
{{- if eq .Values.global.praefect.enabled true }}
WARNING: The Praefect chart has been enabled. Please note that it is still under development and not ready for production use. Usage may require significant manual intervention during upgrades.
{{- end }}

{{/* Resource request changes */}}
NOTICE: The resource requests have increased for the Webservice and Sidekiq charts.
    For more information on Webservice resources, see https://docs.gitlab.com/charts/charts/gitlab/webservice/index.html#resources
    For more information on Sidekiq resources, see https://docs.gitlab.com/charts/charts/gitlab/sidekiq/index.html#resource
    Related merge request: https://gitlab.com/gitlab-org/charts/gitlab/-/merge_requests/1634

    To restore the original resource specifications:
    --set gitlab.sidekiq.resources.requests.cpu=50m
    --set gitlab.sidekiq.resources.requests.memory=650M
    --set gitlab.webservice.resources.requests.memory=1.5G

{{/* If shared-secrets is disable, manual secret creation will be needed */}}
{{- if not (index .Values "shared-secrets").enabled }}
NOTICE: The automatic generation of secrets has been disabled.
The user should ensure all necessary secrets are created according to documentation, or the deployment will fail to operate correctly.
{{- end }}
{{/* If using self-signed auto-generated certificates, and a service needing them is enabled */}}
{{- if or .Values.gitlab.webservice.enabled .Values.registry.enabled .Values.global.minio.enabled }}
{{-   if not (or .Values.global.ingress.configureCertmanager (include "gitlab.ingress.tls.configured" .)) }}
WARNING: Automatic TLS certificate generation with cert-manager is disabled and no TLS certificates were provided. Self-signed certificates were generated.

You may retrieve the CA root for these certificates from the `{{ template "gitlab.wildcard-self-signed-cert-name" $ }}-ca` secret, via the following command. It can then be imported to a web browser or system store.

    kubectl get secret {{ template "gitlab.wildcard-self-signed-cert-name" $ }}-ca -ojsonpath='{.data.cfssl_ca}' | base64 --decode > {{ template "gitlab.gitlab.hostname" $ }}.ca.pem

If you do not wish to use self-signed certificates, please set the following properties:
  - global.ingress.tls.secretName
  OR
  - global.ingress.tls.enabled (set to `true`)
{{- if $.Values.gitlab.webservice.enabled }}
  - gitlab.webservice.ingress.tls.secretName
{{- if $.Values.global.appConfig.smartcard.enabled }}
  - gitlab.webservice.ingress.tls.smartcardSecretName
{{- end }}
{{- end }}
{{- if $.Values.registry.enabled }}
  - registry.ingress.tls.secretName
{{- end }}
{{- if $.Values.global.minio.enabled }}
  - minio.ingress.tls.secretName
{{- end }}

{{- if (index .Values "gitlab-runner").install }}
WARNING: Automatic TLS certificate generation with cert-manager is disabled and no TLS certificates were provided. Self-signed certificates were generated that do not work with gitlab-runner. Please either disable gitlab-runner by setting `gitlab-runner.install=false` or provide valid certificates.
{{- end -}}
{{- end -}}
{{- end -}}
{{/* Runner notice if .install && ! .runners.privileged */}}
{{ if and (index .Values "gitlab-runner").install (not (index .Values "gitlab-runner").runners.privileged) }}
NOTICE: You've installed GitLab Runner without the ability to use 'docker in docker'.
The GitLab Runner chart (gitlab/gitlab-runner) is deployed without the `privileged` flag by default for security purposes. This can be changed by setting `gitlab-runner.runners.privileged` to `true`. Before doing so, please read the GitLab Runner chart's documentation on why we
chose not to enable this by default. See https://docs.gitlab.com/runner/install/kubernetes.html#running-docker-in-docker-containers-with-gitlab-runners
{{- end }}

{{/* task-runner replicas */}}
{{ if eq (index $.Values.gitlab "task-runner" "replicas" | int) 0 }}
NOTICE: The GitLab task-runner is scaled to 0.
    The `task-runner` Pod is very useful for administration and debugging of this application suite. You may configure `gitlab.task-runner.replicas=1` if you wish to leave a Pod running at all times, or you can scale the deployment up when needed:

    `kubectl scale --replicas=1 deployment/{{ .Release.Name }}-task-runner`

{{ end }}

{{/* WARN: global.operator DEPRECATED */}}
{{- if .Values.global.operator.enabled -}}
WARNING: global.operator.enabled is set.
    The gitlab/gitlab-operator chart houses "gitlab-operator". This functionality was Alpha, and marked experimental. This is now DEPRECATED and will be removed in the future.
{{- end }}
{{/* print install survey link */}}
{{- $appVersion := coalesce .Values.global.gitlabVersion .Chart.AppVersion -}}
{{- if and .Release.IsInstall (regexMatch "^\\d+\\.\\d+\\.\\d+(-rc\\d+)?(-pre)?$" $appVersion) }}
Help us improve the installation experience, let us know how we did with a 1 minute survey:
{{ printf "https://gitlab.fra1.qualtrics.com/jfe/form/SV_6kVqZANThUQ1bZb?installation=helm&release=%s" (regexReplaceAll "^(\\d+)\\.(\\d+)\\..+" $appVersion "${1}-${2}") }}
{{- end }}
{{/* run deprecations */}}
{{ include "gitlab.deprecations" . }}
{{/* run checkConfig */}}
{{ include "gitlab.checkConfig" . }}
