Skip to content

Commit

Permalink
Support multiple executors in chart (apache#43606)
Browse files Browse the repository at this point in the history
* modified values

* helm test

* eq to contains

* combine existed tests

* to contains

* contains KubernetesExecutor
  • Loading branch information
jx2lee authored Nov 24, 2024
1 parent 18d1b97 commit 2154e89
Show file tree
Hide file tree
Showing 25 changed files with 36 additions and 46 deletions.
6 changes: 3 additions & 3 deletions chart/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Airflow Webserver:
http{{ if $tlsEnabled }}s{{ end }}://{{ (tpl $hostname $) }}{{ $.Values.ingress.web.path }}/
{{- end }}
{{- end }}
{{- if and (or .Values.ingress.flower.enabled .Values.ingress.enabled) (or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor")) }}
{{- 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 -}}
Expand All @@ -101,7 +101,7 @@ You can now access your dashboard(s) by executing the following command(s) and v
Airflow Webserver: kubectl port-forward svc/{{ include "airflow.fullname" . }}-webserver {{ .Values.ports.airflowUI }}:{{ .Values.ports.airflowUI }} --namespace {{ .Release.Namespace }}

{{- if .Values.flower.enabled }}
{{- if or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor")}}
{{- 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 }}
Expand Down Expand Up @@ -131,7 +131,7 @@ You can get Fernet Key value by running the following:

{{- end }}

{{- if or (eq .Values.executor "KubernetesExecutor") (eq .Values.executor "CeleryKubernetesExecutor") }}
{{- 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:
Expand Down
8 changes: 4 additions & 4 deletions chart/templates/_helpers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ If release name contains chart name it will be used as a full name.
name: {{ template "webserver_secret_key_secret" . }}
key: webserver-secret-key
{{- end }}
{{- if or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor") }}
{{- if or (contains "CeleryExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor) }}
{{- if or (semverCompare "<2.4.0" .Values.airflowVersion) (.Values.data.resultBackendSecretName) (.Values.data.resultBackendConnection) }}
{{- if .Values.enableBuiltInSecretEnvVars.AIRFLOW__CELERY__CELERY_RESULT_BACKEND }}
# (Airflow 1.10.* variant)
Expand Down Expand Up @@ -150,7 +150,7 @@ If release name contains chart name it will be used as a full name.
{{- range $i, $config := .Values.env }}
- name: {{ $config.name }}
value: {{ $config.value | quote }}
{{- if or (eq $.Values.executor "KubernetesExecutor") (eq $.Values.executor "LocalKubernetesExecutor") (eq $.Values.executor "CeleryKubernetesExecutor") }}
{{- if or (contains "KubernetesExecutor" $.Values.executor) (contains "LocalKubernetesExecutor" $.Values.executor) (contains "CeleryKubernetesExecutor" $.Values.executor) }}
- name: AIRFLOW__KUBERNETES_ENVIRONMENT_VARIABLES__{{ $config.name }}
value: {{ $config.value | quote }}
{{- end }}
Expand All @@ -163,7 +163,7 @@ If release name contains chart name it will be used as a full name.
name: {{ $config.secretName }}
key: {{ default "value" $config.secretKey }}
{{- end }}
{{- if or (eq $.Values.executor "LocalKubernetesExecutor") (eq $.Values.executor "KubernetesExecutor") (eq $.Values.executor "CeleryKubernetesExecutor") }}
{{- if or (contains "LocalKubernetesExecutor" $.Values.executor) (contains "KubernetesExecutor" $.Values.executor) (contains "CeleryKubernetesExecutor" $.Values.executor) }}
{{- range $i, $config := .Values.secret }}
- name: AIRFLOW__KUBERNETES_SECRETS__{{ $config.envName }}
value: {{ printf "%s=%s" $config.secretName $config.secretKey }}
Expand Down Expand Up @@ -1056,7 +1056,7 @@ capabilities:
key: {{ $config.valueFrom.configMapKeyRef.key }}
{{- end }}
{{- end }}
{{- if or (eq $.Values.executor "KubernetesExecutor") (eq $.Values.executor "LocalKubernetesExecutor") (eq $.Values.executor "CeleryKubernetesExecutor") }}
{{- if or (contains "KubernetesExecutor" $.Values.executor) (contains "LocalKubernetesExecutor" $.Values.executor) (contains "CeleryKubernetesExecutor" $.Values.executor) }}
- name: AIRFLOW__KUBERNETES_ENVIRONMENT_VARIABLES__{{ $config.name }}
{{- if $config.value }}
value: {{ $config.value | quote }}
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/check-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The sole purpose of this yaml file is it to check the values file is consistent
#############################
*/ -}}

{{- if or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor") }}
{{- if or (contains "CeleryExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor) }}
{{- if .Values.redis.enabled }}

{{- if .Values.redis.passwordSecretName }}
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/configmaps/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ data:
{{- .Values.dags.gitSync.knownHosts | nindent 4 }}
{{- end }}

{{- if or (eq $.Values.executor "LocalKubernetesExecutor") (eq $.Values.executor "KubernetesExecutor") (eq $.Values.executor "CeleryKubernetesExecutor") }}
{{- if or (contains "LocalKubernetesExecutor" $.Values.executor) (contains "KubernetesExecutor" $.Values.executor) (contains "CeleryKubernetesExecutor" $.Values.executor) }}
{{- if semverCompare ">=1.10.12" .Values.airflowVersion }}
pod_template_file.yaml: |-
{{- if .Values.podTemplate }}
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/flower/flower-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
## Airflow Flower Deployment
#################################
{{- if .Values.flower.enabled }}
{{- if or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor") }}
{{- if or (contains "CeleryExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor) }}
{{- $nodeSelector := or .Values.flower.nodeSelector .Values.nodeSelector }}
{{- $affinity := or .Values.flower.affinity .Values.affinity }}
{{- $tolerations := or .Values.flower.tolerations .Values.tolerations }}
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/flower/flower-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
## Airflow Flower Ingress
#################################
{{- if .Values.flower.enabled }}
{{- if and (or .Values.ingress.flower.enabled .Values.ingress.enabled) (or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor")) }}
{{- if and (or .Values.ingress.flower.enabled .Values.ingress.enabled) (or (contains "CeleryExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor)) }}
{{- $fullname := (include "airflow.fullname" .) }}
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/flower/flower-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
## Airflow Flower Service Component
#################################
{{- if .Values.flower.enabled }}
{{- if or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor") }}
{{- if or (contains "CeleryExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor) }}
apiVersion: v1
kind: Service
metadata:
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/flower/flower-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
######################################
## Airflow Flower ServiceAccount
######################################
{{- if and .Values.flower.enabled (or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor")) .Values.flower.serviceAccount.create }}
{{- if and .Values.flower.enabled (or (contains "CeleryExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor)) .Values.flower.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.flower.serviceAccount.automountServiceAccountToken }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ subjects:
name: {{ include "statsd.serviceAccountName" . }}
namespace: "{{ .Release.Namespace }}"
{{- end }}
{{- if and .Values.flower.enabled (or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor")) }}
{{- if and .Values.flower.enabled (or (contains "CeleryExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor)) }}
- kind: ServiceAccount
name: {{ include "flower.serviceAccountName" . }}
namespace: "{{ .Release.Namespace }}"
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/redis/redis-networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
################################
## Airflow Redis NetworkPolicy
#################################
{{- if and .Values.redis.enabled .Values.networkPolicies.enabled (or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor")) }}
{{- if and .Values.redis.enabled .Values.networkPolicies.enabled (or (contains "CeleryExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor)) }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/redis/redis-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
################################
## Airflow Redis Service
#################################
{{- if and .Values.redis.enabled (or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor")) }}
{{- if and .Values.redis.enabled (or (contains "CeleryExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor)) }}
apiVersion: v1
kind: Service
metadata:
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/redis/redis-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
######################################
## Airflow Redis ServiceAccount
######################################
{{- if and .Values.redis.enabled .Values.redis.serviceAccount.create (or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor")) }}
{{- if and .Values.redis.enabled .Values.redis.serviceAccount.create (or (contains "CeleryExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor)) }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.redis.serviceAccount.automountServiceAccountToken }}
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/redis/redis-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
################################
## Airflow Redis StatefulSet
#################################
{{- if and .Values.redis.enabled (or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor")) }}
{{- if and .Values.redis.enabled (or (contains "CeleryExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor)) }}
{{- $nodeSelector := or .Values.redis.nodeSelector .Values.nodeSelector }}
{{- $affinity := or .Values.redis.affinity .Values.affinity }}
{{- $tolerations := or .Values.redis.tolerations .Values.tolerations }}
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/scheduler/scheduler-networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ spec:
release: {{ .Release.Name }}
policyTypes:
- Ingress
{{- if eq .Values.executor "LocalExecutor" }}
{{- if contains "LocalExecutor" .Values.executor }}
ingress:
- from:
- podSelector:
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/scheduler/scheduler-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
## Airflow Scheduler Service
#################################
{{- if .Values.scheduler.enabled }}
{{- if or (eq .Values.executor "LocalExecutor") (eq .Values.executor "LocalKubernetesExecutor") }}
{{- if or (contains "LocalExecutor" .Values.executor) (contains "LocalKubernetesExecutor" .Values.executor) }}
apiVersion: v1
kind: Service
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
## Airflow Result Backend Secret
#################################
{{- if not .Values.data.resultBackendSecretName }}
{{- if or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor") }}
{{- if or (contains "CeleryExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor) }}
{{- if or (semverCompare "<2.4.0" .Values.airflowVersion) (and (semverCompare ">=2.4.0" .Values.airflowVersion) .Values.data.resultBackendConnection) }}
{{- $connection := .Values.data.resultBackendConnection | default .Values.data.metadataConnection }}
{{- $resultBackendHost := $connection.host | default (printf "%s-%s" .Release.Name "postgresql") }}
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/workers/worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{{- $persistence := .Values.workers.persistence.enabled }}
{{- $keda := .Values.workers.keda.enabled }}
{{- $hpa := and .Values.workers.hpa.enabled (not .Values.workers.keda.enabled) }}
{{- if or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor") }}
{{- if or (contains "CeleryExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor) }}
{{- $nodeSelector := or .Values.workers.nodeSelector .Values.nodeSelector }}
{{- $affinity := or .Values.workers.affinity .Values.affinity }}
{{- $tolerations := or .Values.workers.tolerations .Values.tolerations }}
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/workers/worker-kedaautoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
################################
## Airflow Worker KEDA Scaler
#################################
{{- if and .Values.workers.keda.enabled (has .Values.executor (list "CeleryExecutor" "CeleryKubernetesExecutor")) }}
{{- if and .Values.workers.keda.enabled (or (contains "CeleryExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor) ) }}
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/workers/worker-networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
################################
## Airflow Worker NetworkPolicy
#################################
{{- if and .Values.networkPolicies.enabled (or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor")) }}
{{- if and .Values.networkPolicies.enabled (or (contains "CeleryExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor)) }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/workers/worker-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
################################
## Airflow Worker Service
#################################
{{- if or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor") }}
{{- if or (contains "CeleryExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor) }}
apiVersion: v1
kind: Service
metadata:
Expand Down
2 changes: 1 addition & 1 deletion chart/templates/workers/worker-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
################################
## Airflow Worker ServiceAccount
#################################
{{- if and .Values.workers.serviceAccount.create (or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor") (eq .Values.executor "KubernetesExecutor") (eq .Values.executor "LocalKubernetesExecutor")) }}
{{- if and .Values.workers.serviceAccount.create (or (contains "CeleryExecutor" .Values.executor) (contains "CeleryKubernetesExecutor" .Values.executor) (contains "KubernetesExecutor" .Values.executor) (contains "LocalKubernetesExecutor" .Values.executor)) }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.workers.serviceAccount.automountServiceAccountToken }}
Expand Down
12 changes: 2 additions & 10 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -687,15 +687,7 @@
"type": "string",
"x-docsSection": "Common",
"default": "CeleryExecutor",
"enum": [
"LocalExecutor",
"LocalKubernetesExecutor",
"CeleryExecutor",
"KubernetesExecutor",
"CeleryKubernetesExecutor",
"airflow.providers.amazon.aws.executors.batch.AwsBatchExecutor",
"airflow.providers.amazon.aws.executors.ecs.AwsEcsExecutor"
]
"pattern": "^(LocalExecutor|LocalKubernetesExecutor|CeleryExecutor|KubernetesExecutor|CeleryKubernetesExecutor|airflow.providers.amazon.aws.executors.batch.AwsBatchExecutor|airflow.providers.amazon.aws.executors.ecs.AwsEcsExecutor)(,(LocalExecutor|LocalKubernetesExecutor|CeleryExecutor|KubernetesExecutor|CeleryKubernetesExecutor|airflow.providers.amazon.aws.executors.batch.AwsBatchExecutor|airflow.providers.amazon.aws.executors.ecs.AwsEcsExecutor))*$"
},
"allowPodLaunching": {
"description": "Whether various Airflow components launch pods.",
Expand Down Expand Up @@ -1717,7 +1709,7 @@
"query": {
"description": "Query to use for KEDA autoscaling. Must return a single integer.",
"type": "string",
"default": "SELECT ceil(COUNT(*)::decimal / {{ .Values.config.celery.worker_concurrency }}) FROM task_instance WHERE (state='running' OR state='queued') {{- if eq .Values.executor \"CeleryKubernetesExecutor\" }} AND queue != '{{ .Values.config.celery_kubernetes_executor.kubernetes_queue }}' {{- end }}"
"default": "SELECT ceil(COUNT(*)::decimal / {{ .Values.config.celery.worker_concurrency }}) FROM task_instance WHERE (state='running' OR state='queued') {{- if or (contains \"CeleryKubernetesExecutor\" .Values.executor) (contains \"KubernetesExecutor\" .Values.executor) }} AND queue != '{{ .Values.config.celery_kubernetes_executor.kubernetes_queue }}' {{- end }}"
},
"usePgbouncer": {
"description": "Weather to use PGBouncer to connect to the database or not when it is enabled. This configuration will be ignored if PGBouncer is not enabled.",
Expand Down
4 changes: 3 additions & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ rbac:

# Airflow executor
# One of: LocalExecutor, LocalKubernetesExecutor, CeleryExecutor, KubernetesExecutor, CeleryKubernetesExecutor
# Specify executors in a prioritized list to leverage multiple execution environments as needed.
executor: "CeleryExecutor"

# If this is true and using LocalExecutor/KubernetesExecutor/CeleryKubernetesExecutor, the scheduler's
Expand Down Expand Up @@ -655,7 +656,8 @@ workers:
SELECT ceil(COUNT(*)::decimal / {{ .Values.config.celery.worker_concurrency }})
FROM task_instance
WHERE (state='running' OR state='queued')
{{- if eq .Values.executor "CeleryKubernetesExecutor" }}
{{- if or (contains "CeleryKubernetesExecutor" .Values.executor)
(contains "KubernetesExecutor" .Values.executor) }}
AND queue != '{{ .Values.config.celery_kubernetes_executor.kubernetes_queue }}'
{{- end }}
Expand Down
10 changes: 2 additions & 8 deletions helm_tests/airflow_aux/test_basic_helm_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ def get_k8s_objs_with_image(obj: list[Any] | dict[str, Any]) -> list[dict[str, A
"CeleryKubernetesExecutor",
"airflow.providers.amazon.aws.executors.batch.AwsBatchExecutor",
"airflow.providers.amazon.aws.executors.ecs.AwsEcsExecutor",
"CeleryExecutor,KubernetesExecutor",
],
)
def test_supported_executor(self, executor):
Expand All @@ -549,20 +550,13 @@ def test_supported_executor(self, executor):
)

def test_unsupported_executor(self):
with pytest.raises(CalledProcessError) as ex_ctx:
with pytest.raises(CalledProcessError):
render_chart(
"test-basic",
{
"executor": "SequentialExecutor",
},
)
assert (
'executor must be one of the following: "LocalExecutor", '
'"LocalKubernetesExecutor", "CeleryExecutor", '
'"KubernetesExecutor", "CeleryKubernetesExecutor", '
'"airflow.providers.amazon.aws.executors.batch.AwsBatchExecutor", '
'"airflow.providers.amazon.aws.executors.ecs.AwsEcsExecutor"' in ex_ctx.value.stderr.decode()
)

@pytest.mark.parametrize(
"image",
Expand Down
4 changes: 3 additions & 1 deletion helm_tests/other/test_keda.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def build_query(executor, concurrency=16, queue=None):
f"SELECT ceil(COUNT(*)::decimal / {concurrency}) "
"FROM task_instance WHERE (state='running' OR state='queued')"
)
if executor == "CeleryKubernetesExecutor":
if "CeleryKubernetesExecutor" in executor or "KubernetesExecutor" in executor:
query += f" AND queue != '{queue or 'kubernetes'}'"
return query

Expand Down Expand Up @@ -121,6 +121,8 @@ def test_keda_concurrency(self, executor, concurrency):
("CeleryExecutor", "my_queue", False),
("CeleryKubernetesExecutor", None, True),
("CeleryKubernetesExecutor", "my_queue", True),
("CeleryExecutor,KubernetesExecutor", "None", False),
("CeleryExecutor,KubernetesExecutor", "my_queue", True),
],
)
def test_keda_query_kubernetes_queue(self, executor, queue, should_filter):
Expand Down

0 comments on commit 2154e89

Please sign in to comment.