You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When setting a KubernetesPodOperatorAsync task that is currently in the deferred state to failed in the UI, the underlying pod will not be killed.
To Reproduce
Deploy the following DAG to Astro:
from datetime import datetime, timedelta
from airflow import DAG
from airflow.configuration import conf
from astronomer.providers.cncf.kubernetes.operators.kubernetes_pod import KubernetesPodOperatorAsync
from kubernetes.client import models as k8s
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2019, 1, 1),
'email_on_failure': False,
'email_on_retry': False,
'retries': 1,
'retry_delay': timedelta(minutes=5),
}
namespace = conf.get('kubernetes', 'NAMESPACE')
dag = DAG("example_kubernetes_pod", schedule_interval="@once", default_args=default_args)
# This is where we define our desired resources.
compute_resources = k8s.V1ResourceRequirements(
limits={"cpu": "800m", "memory": "3Gi"},
requests={"cpu": "800m", "memory": "3Gi"}
)
with dag:
KubernetesPodOperatorAsync(
namespace=namespace,
image="alpine",
cmds=["sh", "-c", "while true; do sleep 30; done;"],
labels={"foo": "bar"},
name="airflow-test-pod",
task_id="task-one",
in_cluster=True,
resources=compute_resources,
is_delete_operator_pod=True,
get_logs=True,
)
Trigger the DAG, then mark the task as failed from the UI.
Expected behavior
The task should be set to failed and the pod should be killed.
The text was updated successfully, but these errors were encountered:
Describe the bug
When setting a
KubernetesPodOperatorAsync
task that is currently in thedeferred
state tofailed
in the UI, the underlying pod will not be killed.To Reproduce
Deploy the following DAG to Astro:
Trigger the DAG, then mark the task as failed from the UI.
Expected behavior
The task should be set to
failed
and the pod should be killed.The text was updated successfully, but these errors were encountered: