{{/*
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
*/}}


Thank you for installing Apache {{ title .Chart.Name }} {{ .Values.airflowVersion }}!

Your release is named {{ .Release.Name }}.

{{- if or .Values.ingress.web.enabled .Values.ingress.flower.enabled .Values.ingress.enabled }}
You can now access your service(s) by following defined Ingress urls:

{{- if .Values.ingress.web.host }}

DEPRECATION WARNING:
   `ingress.web.host` has been renamed to `ingress.web.hosts` and is now an array.
   Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.ingress.web.tls }}

DEPRECATION WARNING:
   `ingress.web.tls` has been renamed to `ingress.web.hosts[*].tls` and can be set per host.
   Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.ingress.flower.host }}

DEPRECATION WARNING:
   `ingress.flower.host` has been renamed to `ingress.flower.hosts` and is now an array.
   Please change your values as support for the old name will be dropped in a future release.

{{- end }}


{{- if .Values.ingress.flower.tls }}

DEPRECATION WARNING:
   `ingress.flower.tls` has been renamed to `ingress.flower.hosts[*].tls` and can be set per host.
   Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.ingress.enabled }}

DEPRECATION WARNING:
   `ingress.enabled` has been deprecated. There are now separate flags to control the webserver and
   flower individually, ``ingress.web.enabled`` and ``ingress.flower.enabled``.
   Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if and .Values.webserver.enabled (or .Values.ingress.web.enabled .Values.ingress.enabled) }}
Airflow Webserver:
{{- range .Values.ingress.web.hosts | default (list .Values.ingress.web.host) }}
      {{- $tlsEnabled := $.Values.ingress.web.tls.enabled -}}
      {{- $hostname := $.Values.ingress.web.host -}}
      {{- $path := $.Values.ingress.web.path -}}
      {{- if . | kindIs "string" | not }}
      {{- $hostname = .name -}}
      {{- if .tls }}
      {{- $tlsEnabled = .tls.enabled -}}
      {{- end }}
      {{- end }}
      http{{ if $tlsEnabled }}s{{ end }}://{{ (tpl $hostname $) }}{{ $path }}{{ if (hasSuffix "/" $path) | not }}/{{ end }}
{{- end }}
{{- end }}
{{- if and (or .Values.ingress.flower.enabled .Values.ingress.enabled) (or (contains "CeleryExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor)) }}
Flower Dashboard:
{{- range .Values.ingress.flower.hosts | default (list .Values.ingress.flower.host) }}
      {{- $tlsEnabled := $.Values.ingress.flower.tls.enabled -}}
      {{- $hostname := $.Values.ingress.flower.host -}}
      {{- $path := $.Values.ingress.flower.path -}}
      {{- if . | kindIs "string" | not }}
      {{- $hostname = .name -}}
      {{- if .tls }}
      {{- $tlsEnabled = .tls.enabled -}}
      {{- end }}
      {{- end }}
      http{{ if $tlsEnabled }}s{{ end }}://{{ (tpl $hostname $) }}{{ $path }}{{ if (hasSuffix "/" $path) | not }}/{{ end }}
{{- end }}
{{- end }}
{{- else }}
You can now access your dashboard(s) by executing the following command(s) and visiting the corresponding port at localhost in your browser:

{{- if semverCompare "<3.0.0" .Values.airflowVersion }}
Airflow Webserver:     kubectl port-forward svc/{{ include "airflow.fullname" . }}-webserver {{ .Values.ports.airflowUI }}:{{ .Values.ports.airflowUI }} --namespace {{ .Release.Namespace }}
{{- else }}
Airflow API Server:     kubectl port-forward svc/{{ include "airflow.fullname" . }}-api-server {{ .Values.ports.airflowUI }}:{{ .Values.ports.airflowUI }} --namespace {{ .Release.Namespace }}
{{- end }}

{{- if .Values.flower.enabled }}
{{- if or (contains "CeleryExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor)}}
Flower Dashboard:      kubectl port-forward svc/{{ include "airflow.fullname" . }}-flower {{ .Values.ports.flowerUI }}:{{ .Values.ports.flowerUI }} --namespace {{ .Release.Namespace }}
{{- end }}
{{- end }}
{{- end }}

{{- if or .Values.ingress.apiServer.enabled .Values.ingress.enabled }}

{{- if .Values.ingress.apiServer.host }}

DEPRECATION WARNING:
   `ingress.apiServer.host` has been renamed to `ingress.apiServer.hosts` and is now an array.
   Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.ingress.apiServer.tls.enabled }}

DEPRECATION WARNING:
   `ingress.apiServer.tls` has been renamed to `ingress.apiServer.hosts[*].tls` and can be set per host.
   Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- end }}

{{- if and .Values.ingress.statsd.enabled .Values.ingress.statsd.host }}

DEPRECATION WARNING:
   `ingress.statsd.host` has been renamed to `ingress.statsd.hosts` and is now an array.
   Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if and .Values.ingress.pgbouncer.enabled .Values.ingress.pgbouncer.host }}

DEPRECATION WARNING:
   `ingress.pgbouncer.host` has been renamed to `ingress.pgbouncer.hosts` and is now an array.
   Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if eq (include "createUserJob.isEnabled" .) "true" }}
Default user (Airflow UI) Login credentials:
    username: {{ if .Values.webserver.defaultUser }}{{ .Values.webserver.defaultUser.username }}{{ else }}{{ .Values.createUserJob.defaultUser.username }}{{ end }}
    password: {{ if .Values.webserver.defaultUser }}{{ .Values.webserver.defaultUser.password }}{{ else }}{{ .Values.createUserJob.defaultUser.password }}{{ end }}
{{- end }}

{{- if .Values.postgresql.enabled }}
Default Postgres connection credentials:
    username: {{ .Values.data.metadataConnection.user }}
    password: {{ .Values.data.metadataConnection.pass }}
    port: {{ .Values.data.metadataConnection.port }}

{{- end }}

{{- if not .Values.fernetKeySecretName }}

You can get Fernet Key value by running the following:

    echo Fernet Key: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "airflow.fullname" . }}-fernet-key -o jsonpath="{.data.fernet-key}" | base64 --decode)

{{- end }}

{{- if or (contains "KubernetesExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor) }}
{{- if and (not .Values.logs.persistence.enabled) (eq (lower (tpl .Values.config.logging.remote_logging .)) "false") }}

WARNING:
    Kubernetes workers task logs may not persist unless you configure log persistence or remote logging!
    Logging options can be found at: https://airflow.apache.org/docs/helm-chart/stable/manage-logs.html
    (This warning can be ignored if logging is configured with environment variables or secrets backend)

{{- end }}
{{- end }}

{{- if and .Values.dags.gitSync.enabled .Values.dags.gitSync.sshKeySecret (not .Values.dags.gitSync.knownHosts)}}

#####################################################
#  WARNING: You should set dags.gitSync.knownHosts  #
#####################################################

You are using ssh authentication for your gitsync repo, however you currently have SSH known_hosts verification disabled,
making you susceptible to man-in-the-middle attacks!

Information on how to set knownHosts can be found here:
https://airflow.apache.org/docs/helm-chart/stable/production-guide.html#knownhosts

{{- end }}

{{- if and .Values.dags.gitSync.enabled .Values.dags.gitSync.readinessProbe }}

 DEPRECATION WARNING:
    `dags.gitSync.readinessProbe` section has been removed as Git-Sync is not service-type object.
    Please remove overwrite values of section, if defined, as support it will be removed in a future release.

{{- end }}

{{- if .Values.flower.extraNetworkPolicies }}

DEPRECATION WARNING:
   `flower.extraNetworkPolicies` has been renamed to `flower.networkPolicy.peers`.
   Please change your values as support for the old name will be dropped in a future release.

{{- end }}


{{- if .Values.webserver.extraNetworkPolicies }}

DEPRECATION WARNING:
    `webserver.extraNetworkPolicies` has been renamed to `webserver.networkPolicy.peers`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.securityContext }}

 DEPRECATION WARNING:
    `securityContext` has been renamed to `securityContexts`, to be enabled on container and pod level.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.scheduler.securityContext }}

 DEPRECATION WARNING:
    `scheduler.securityContext` has been renamed to `scheduler.securityContexts`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.webserver.securityContext }}

 DEPRECATION WARNING:
    `webserver.securityContext` has been renamed to `webserver.securityContexts`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.statsd.securityContext }}

 DEPRECATION WARNING:
    `statsd.securityContext` has been renamed to `statsd.securityContexts`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (int .Values.workers.replicas) 1 }}

 DEPRECATION WARNING:
    `workers.replicas` has been renamed to `workers.celery.replicas`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.revisionHistoryLimit) }}

 DEPRECATION WARNING:
    `workers.revisionHistoryLimit` has been renamed to `workers.celery.revisionHistoryLimit`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.command) }}

 DEPRECATION WARNING:
    `workers.command` has been renamed to `workers.celery.command`/`workers.kubernetes.command`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (.Values.workers.args | toJson) (list "bash" "-c" "exec \\\nairflow celery worker\n{{- if and .Values.workers.queue (ne .Values.workers.queue \"default\") }}\n{{- \" -q \" }}{{ .Values.workers.queue }}\n{{- end }}" | toJson) }}

 DEPRECATION WARNING:
    `workers.args` has been renamed to `workers.celery.args`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not .Values.workers.livenessProbe.enabled }}

 DEPRECATION WARNING:
    `workers.livenessProbe.enabled` has been renamed to `workers.celery.livenessProbe.enabled`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (int .Values.workers.livenessProbe.initialDelaySeconds) 10 }}

 DEPRECATION WARNING:
    `workers.livenessProbe.initialDelaySeconds` has been renamed to `workers.celery.livenessProbe.initialDelaySeconds`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (int .Values.workers.livenessProbe.timeoutSeconds) 20 }}

 DEPRECATION WARNING:
    `workers.livenessProbe.timeoutSeconds` has been renamed to `workers.celery.livenessProbe.timeoutSeconds`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (int .Values.workers.livenessProbe.failureThreshold) 5 }}

 DEPRECATION WARNING:
    `workers.livenessProbe.failureThreshold` has been renamed to `workers.celery.livenessProbe.failureThreshold`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (int .Values.workers.livenessProbe.periodSeconds) 60 }}

 DEPRECATION WARNING:
    `workers.livenessProbe.periodSeconds` has been renamed to `workers.celery.livenessProbe.periodSeconds`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.livenessProbe.command) }}

 DEPRECATION WARNING:
    `workers.livenessProbe.command` has been renamed to `workers.celery.livenessProbe.command`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.updateStrategy) }}

 DEPRECATION WARNING:
    `workers.updateStrategy` has been renamed to `workers.celery.updateStrategy`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (toJson .Values.workers.strategy | quote) (toJson "{\"rollingUpdate\":{\"maxSurge\":\"100%\",\"maxUnavailable\":\"50%\"}}") }}

 DEPRECATION WARNING:
    `workers.strategy` has been renamed to `workers.celery.strategy`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.podManagementPolicy) }}

 DEPRECATION WARNING:
    `workers.podManagementPolicy` has been renamed to `workers.celery.podManagementPolicy`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.securityContext) }}

 DEPRECATION WARNING:
    `workers.securityContext` has been renamed to `workers.celery.securityContexts`/`workers.kubernetes.securityContexts`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.securityContexts.pod) }}

 DEPRECATION WARNING:
    `workers.securityContexts.pod` has been renamed to `workers.celery.securityContexts.pod`/`workers.kubernetes.securityContexts.pod`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.securityContexts.container) }}

 DEPRECATION WARNING:
    `workers.securityContexts.container` has been renamed to `workers.celery.securityContexts.container`/`workers.kubernetes.securityContexts.container`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.containerLifecycleHooks) }}

 DEPRECATION WARNING:
    `workers.containerLifecycleHooks` has been renamed to `workers.celery.containerLifecycleHooks`/`workers.kubernetes.containerLifecycleHooks`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.workers.podDisruptionBudget.enabled }}

 DEPRECATION WARNING:
    `workers.podDisruptionBudget.enabled` has been renamed to `workers.celery.podDisruptionBudget.enabled`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (int .Values.workers.podDisruptionBudget.config.maxUnavailable) 1 }}

 DEPRECATION WARNING:
    `workers.podDisruptionBudget.config.maxUnavailable` has been renamed to `workers.celery.podDisruptionBudget.config.maxUnavailable`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if hasKey .Values.workers.podDisruptionBudget.config "minAvailable" }}

 DEPRECATION WARNING:
    `workers.podDisruptionBudget.config.minAvailable` has been renamed to `workers.celery.podDisruptionBudget.config.minAvailable`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not .Values.workers.serviceAccount.automountServiceAccountToken }}

 DEPRECATION WARNING:
    `workers.serviceAccount.automountServiceAccountToken` has been renamed to `workers.celery.serviceAccount.automountServiceAccountToken`/`workers.kubernetes.serviceAccount.automountServiceAccountToken`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not .Values.workers.serviceAccount.create }}

 DEPRECATION WARNING:
    `workers.serviceAccount.create` has been renamed to `workers.celery.serviceAccount.create`/`workers.kubernetes.serviceAccount.create`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.serviceAccount.name) }}

 DEPRECATION WARNING:
    `workers.serviceAccount.name` has been renamed to `workers.celery.serviceAccount.name`/`workers.kubernetes.serviceAccount.name`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.serviceAccount.annotations) }}

 DEPRECATION WARNING:
    `workers.serviceAccount.annotations` has been renamed to `workers.celery.serviceAccount.annotations`/`workers.kubernetes.serviceAccount.annotations`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.workers.keda.enabled }}

 DEPRECATION WARNING:
    `workers.keda.enabled` has been renamed to `workers.celery.keda.enabled`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.keda.namespaceLabels) }}

 DEPRECATION WARNING:
    `workers.keda.namespaceLabels` has been renamed to `workers.celery.keda.namespaceLabels`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (int .Values.workers.keda.pollingInterval) 5 }}

 DEPRECATION WARNING:
    `workers.keda.pollingInterval` has been renamed to `workers.celery.keda.pollingInterval`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (int .Values.workers.keda.cooldownPeriod) 30 }}

 DEPRECATION WARNING:
    `workers.keda.cooldownPeriod` has been renamed to `workers.celery.keda.cooldownPeriod`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (int .Values.workers.keda.minReplicaCount) 0 }}

 DEPRECATION WARNING:
    `workers.keda.minReplicaCount` has been renamed to `workers.celery.keda.minReplicaCount`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (int .Values.workers.keda.maxReplicaCount) 10 }}

 DEPRECATION WARNING:
    `workers.keda.maxReplicaCount` has been renamed to `workers.celery.keda.maxReplicaCount`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.keda.advanced) }}

 DEPRECATION WARNING:
    `workers.keda.advanced` has been renamed to `workers.celery.keda.advanced`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (quote .Values.workers.keda.query) (quote "SELECT ceil(COUNT(*)::decimal / {{ .Values.config.celery.worker_concurrency }}) FROM task_instance WHERE (state='running' OR state='queued') AND queue IN ( {{- range $i, $q := splitList \",\" .Values.workers.queue -}} {{- if $i }},{{ end }}'{{ $q | trim }}' {{- end -}} ) {{- if contains \"CeleryKubernetesExecutor\" .Values.executor }} AND queue != '{{ .Values.config.celery_kubernetes_executor.kubernetes_queue }}' {{- else if contains \"KubernetesExecutor\" .Values.executor }} AND executor IS DISTINCT FROM 'KubernetesExecutor' {{- else if contains \"airflow.providers.edge3.executors.EdgeExecutor\" .Values.executor }} AND executor IS DISTINCT FROM 'EdgeExecutor' {{- end }}") }}

 DEPRECATION WARNING:
    `workers.keda.query` has been renamed to `workers.celery.keda.query`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not .Values.workers.keda.usePgbouncer }}

 DEPRECATION WARNING:
    `workers.keda.usePgbouncer` has been renamed to `workers.celery.keda.usePgbouncer`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.workers.hpa.enabled }}

 DEPRECATION WARNING:
    `workers.hpa.enabled` has been renamed to `workers.celery.hpa.enabled`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (int .Values.workers.hpa.minReplicaCount) 0 }}

 DEPRECATION WARNING:
    `workers.hpa.minReplicaCount` has been renamed to `workers.celery.hpa.minReplicaCount`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (int .Values.workers.hpa.maxReplicaCount) 5 }}

 DEPRECATION WARNING:
    `workers.hpa.maxReplicaCount` has been renamed to `workers.celery.hpa.maxReplicaCount`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (toJson .Values.workers.hpa.metrics | quote) (toJson "[{\"resource\":{\"name\":\"cpu\",\"target\":{\"averageUtilization\":80,\"type\":\"Utilization\"}},\"type\":\"Resource\"}]") }}

 DEPRECATION WARNING:
    `workers.hpa.metrics` has been renamed to `workers.celery.hpa.metrics`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.hpa.behavior) }}

 DEPRECATION WARNING:
    `workers.hpa.behavior` has been renamed to `workers.celery.hpa.behavior`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not .Values.workers.persistence.enabled }}

 DEPRECATION WARNING:
    `workers.persistence.enabled` has been renamed to `workers.celery.persistence.enabled`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.persistence.persistentVolumeClaimRetentionPolicy) }}

 DEPRECATION WARNING:
    `workers.persistence.persistentVolumeClaimRetentionPolicy` has been renamed to `workers.celery.persistence.persistentVolumeClaimRetentionPolicy`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne .Values.workers.persistence.size "100Gi" }}

 DEPRECATION WARNING:
    `workers.persistence.size` has been renamed to `workers.celery.persistence.size`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.persistence.storageClassName) }}

 DEPRECATION WARNING:
    `workers.persistence.storageClassName` has been renamed to `workers.celery.persistence.storageClassName`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.workers.persistence.fixPermissions }}

 DEPRECATION WARNING:
    `workers.persistence.fixPermissions` has been renamed to `workers.celery.persistence.fixPermissions`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.persistence.annotations) }}

 DEPRECATION WARNING:
    `workers.persistence.annotations` has been renamed to `workers.celery.persistence.annotations`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.workers.persistence.securityContexts.container }}

 DEPRECATION WARNING:
    `workers.persistence.securityContexts` has been renamed to `workers.celery.persistence.securityContexts`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.workers.kerberosSidecar.enabled }}

 DEPRECATION WARNING:
    `workers.kerberosSidecar.enabled` has been renamed to `workers.celery.kerberosSidecar.enabled`/`workers.kubernetes.kerberosSidecar.enabled`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.workers.kerberosSidecar.resources }}

 DEPRECATION WARNING:
    `workers.kerberosSidecar.resources` has been renamed to `workers.celery.kerberosSidecar.resources`/`workers.kubernetes.kerberosSidecar.resources`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.workers.kerberosSidecar.securityContexts.container }}

 DEPRECATION WARNING:
    `workers.kerberosSidecar.securityContexts.container` has been renamed to `workers.celery.kerberosSidecar.securityContexts.container`/`workers.kubernetes.kerberosSidecar.securityContexts.container`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.workers.kerberosSidecar.containerLifecycleHooks }}

 DEPRECATION WARNING:
    `workers.kerberosSidecar.containerLifecycleHooks` has been renamed to `workers.celery.kerberosSidecar.containerLifecycleHooks`/`workers.kubernetes.kerberosSidecar.containerLifecycleHooks`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.workers.kerberosInitContainer.enabled }}

 DEPRECATION WARNING:
    `workers.kerberosInitContainer.enabled` has been renamed to `workers.celery.kerberosInitContainer.enabled`/`workers.kubernetes.kerberosInitContainer.enabled`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.workers.kerberosInitContainer.resources }}

 DEPRECATION WARNING:
    `workers.kerberosInitContainer.resources` has been renamed to `workers.celery.kerberosInitContainer.resources`/`workers.kubernetes.kerberosInitContainer.resources`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.workers.kerberosInitContainer.securityContexts.container }}

 DEPRECATION WARNING:
    `workers.kerberosInitContainer.securityContexts.container` has been renamed to `workers.celery.kerberosInitContainer.securityContexts.container`/`workers.kubernetes.kerberosInitContainer.securityContexts.container`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.workers.kerberosInitContainer.containerLifecycleHooks }}

 DEPRECATION WARNING:
    `workers.kerberosInitContainer.containerLifecycleHooks` has been renamed to `workers.celery.kerberosInitContainer.containerLifecycleHooks`/`workers.kubernetes.kerberosInitContainer.containerLifecycleHooks`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.resources) }}

 DEPRECATION WARNING:
    `workers.resources` has been renamed to `workers.celery.resources`/`workers.kubernetes.resources`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (int .Values.workers.terminationGracePeriodSeconds) 600 }}

 DEPRECATION WARNING:
    `workers.terminationGracePeriodSeconds` has been renamed to `workers.celery.terminationGracePeriodSeconds`/`workers.kubernetes.terminationGracePeriodSeconds`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if .Values.workers.safeToEvict }}

 DEPRECATION WARNING:
    `workers.safeToEvict` has been renamed to `workers.celery.safeToEvict`/`workers.kubernetes.safeToEvict`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.extraContainers) }}

 DEPRECATION WARNING:
    `workers.extraContainers` has been renamed to `workers.celery.extraContainers`/`workers.kubernetes.extraContainers`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.extraInitContainers) }}

 DEPRECATION WARNING:
    `workers.extraInitContainers` has been renamed to `workers.celery.extraInitContainers`/`workers.kubernetes.extraInitContainers`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.extraVolumes) }}

 DEPRECATION WARNING:
    `workers.extraVolumes` has been renamed to `workers.celery.extraVolumes`/`workers.kubernetes.extraVolumes`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.extraVolumeMounts) }}

 DEPRECATION WARNING:
    `workers.extraVolumeMounts` has been renamed to `workers.celery.extraVolumeMounts`/`workers.kubernetes.extraVolumeMounts`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.runtimeClassName) }}

 DEPRECATION WARNING:
    `workers.runtimeClassName` has been renamed to `workers.celery.runtimeClassName`/`workers.kubernetes.runtimeClassName`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.priorityClassName) }}

 DEPRECATION WARNING:
    `workers.priorityClassName` has been renamed to `workers.celery.priorityClassName`/`workers.kubernetes.priorityClassName`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.affinity) }}

 DEPRECATION WARNING:
    `workers.affinity` has been renamed to `workers.celery.affinity`/`workers.kubernetes.affinity`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.tolerations) }}

 DEPRECATION WARNING:
    `workers.tolerations` has been renamed to `workers.celery.tolerations`/`workers.kubernetes.tolerations`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.topologySpreadConstraints) }}

 DEPRECATION WARNING:
    `workers.topologySpreadConstraints` has been renamed to `workers.celery.topologySpreadConstraints`/`workers.kubernetes.topologySpreadConstraints`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.nodeSelector) }}

 DEPRECATION WARNING:
    `workers.nodeSelector` has been renamed to `workers.celery.nodeSelector`/`workers.kubernetes.nodeSelector`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.extraPorts) }}

 DEPRECATION WARNING:
    `workers.extraPorts` has been renamed to `workers.celery.extraPorts`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.hostAliases) }}

 DEPRECATION WARNING:
    `workers.hostAliases` has been renamed to `workers.celery.hostAliases`/`workers.kubernetes.hostAliases`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.annotations) }}

 DEPRECATION WARNING:
    `workers.annotations` has been renamed to `workers.celery.annotations`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.podAnnotations) }}

 DEPRECATION WARNING:
    `workers.podAnnotations` has been renamed to `workers.celery.podAnnotations`/`workers.kubernetes.podAnnotations`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.labels) }}

 DEPRECATION WARNING:
    `workers.labels` has been renamed to `workers.celery.labels`/`workers.kubernetes.labels`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.volumeClaimTemplates) }}

 DEPRECATION WARNING:
    `workers.volumeClaimTemplates` has been renamed to `workers.celery.volumeClaimTemplates`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.schedulerName) }}

 DEPRECATION WARNING:
    `workers.schedulerName` has been renamed to `workers.celery.schedulerName`/`workers.kubernetes.schedulerName`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not .Values.workers.logGroomerSidecar.enabled }}

 DEPRECATION WARNING:
    `workers.logGroomerSidecar.enabled` has been renamed to `workers.celery.logGroomerSidecar.enabled`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.logGroomerSidecar.command) }}

 DEPRECATION WARNING:
    `workers.logGroomerSidecar.command` has been renamed to `workers.celery.logGroomerSidecar.command`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (.Values.workers.logGroomerSidecar.args | toJson) (list "bash" "/clean-logs" | toJson) }}

 DEPRECATION WARNING:
    `workers.logGroomerSidecar.args` has been renamed to `workers.celery.logGroomerSidecar.args`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (int .Values.workers.logGroomerSidecar.retentionDays) 15 }}

 DEPRECATION WARNING:
    `workers.logGroomerSidecar.retentionDays` has been renamed to `workers.celery.logGroomerSidecar.retentionDays`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (int .Values.workers.logGroomerSidecar.retentionMinutes) 0 }}

 DEPRECATION WARNING:
    `workers.logGroomerSidecar.retentionMinutes` has been renamed to `workers.celery.logGroomerSidecar.retentionMinutes`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (int .Values.workers.logGroomerSidecar.frequencyMinutes) 15 }}

 DEPRECATION WARNING:
    `workers.logGroomerSidecar.frequencyMinutes` has been renamed to `workers.celery.logGroomerSidecar.frequencyMinutes`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (int .Values.workers.logGroomerSidecar.maxSizeBytes) 0 }}

 DEPRECATION WARNING:
    `workers.logGroomerSidecar.maxSizeBytes` has been renamed to `workers.celery.logGroomerSidecar.maxSizeBytes`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if ne (int .Values.workers.logGroomerSidecar.maxSizePercent) 0 }}

 DEPRECATION WARNING:
    `workers.logGroomerSidecar.maxSizePercent` has been renamed to `workers.celery.logGroomerSidecar.maxSizePercent`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.logGroomerSidecar.resources) }}

 DEPRECATION WARNING:
    `workers.logGroomerSidecar.resources` has been renamed to `workers.celery.logGroomerSidecar.resources`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.logGroomerSidecar.securityContexts.container) }}

 DEPRECATION WARNING:
    `workers.logGroomerSidecar.securityContexts.container` has been renamed to `workers.celery.logGroomerSidecar.securityContexts.container`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.logGroomerSidecar.env) }}

 DEPRECATION WARNING:
    `workers.logGroomerSidecar.env` has been renamed to `workers.celery.logGroomerSidecar.env`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.logGroomerSidecar.containerLifecycleHooks) }}

 DEPRECATION WARNING:
    `workers.logGroomerSidecar.containerLifecycleHooks` has been renamed to `workers.celery.logGroomerSidecar.containerLifecycleHooks`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not .Values.workers.waitForMigrations.enabled }}

 DEPRECATION WARNING:
    `workers.waitForMigrations.enabled` has been renamed to `workers.celery.waitForMigrations.enabled`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.waitForMigrations.env) }}

 DEPRECATION WARNING:
    `workers.waitForMigrations.env` has been renamed to `workers.celery.waitForMigrations.env`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.waitForMigrations.securityContexts.container) }}

 DEPRECATION WARNING:
    `workers.waitForMigrations.securityContexts.container` has been renamed to `workers.celery.waitForMigrations.securityContexts.container`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.workers.env) }}

 DEPRECATION WARNING:
    `workers.env` has been renamed to `workers.celery.env`/`workers.kubernetes.env`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.webserver.defaultUser) }}

 DEPRECATION WARNING:
    `webserver.defaultUser` has been renamed to `createUserJob.defaultUser`.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not .Values.dags.gitSync.recommendedProbeSetting }}

 DEPRECATION WARNING:
    Dags Git-Sync bevaiour with `dags.gitSync.recommendedProbeSetting` equal `false` is deprecated and will be removed in future.
    Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (or .Values.webserverSecretKey .Values.webserverSecretKeySecretName .Values.apiSecretKey .Values.apiSecretKeySecretName) }}
{{ if (semverCompare ">=3.0.0" .Values.airflowVersion) }}
#####################################################
#  WARNING: You should set a static API secret key  #
#####################################################
{{ else }}
###########################################################
#  WARNING: You should set a static webserver secret key  #
###########################################################
{{ end }}
{{- $serverKind := ternary "API" "webserver" (semverCompare ">=3.0.0" .Values.airflowVersion) }}
You are using a dynamically generated {{ $serverKind }} secret key, which can lead to
unnecessary restarts of your Airflow components.

Information on how to set a static {{ $serverKind }} secret key can be found here:
https://airflow.apache.org/docs/helm-chart/stable/production-guide.html#api-secret-key

{{- end }}

{{- if or .Values.postgresql.postgresqlUsername .Values.postgresql.postgresqlPassword }}

   {{ fail "postgresql.postgresqlUsername and postgresql.postgresqlPassword are no longer supported. If you wish to use the 'postgres' user, set its password with postgresql.auth.postgresPassword. If you wish to create a different user, do so with postgresql.auth.username and postgresql.auth.password." }}

{{- end }}

{{- if ne .Values.executor (tpl .Values.config.core.executor $) }}
   {{ fail "Please configure the executor with `executor`, not `config.core.executor`." }}
{{- end }}
