Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airflow/providers/cncf/kubernetes/operators/pod.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class KubernetesPodOperator(BaseOperator):
Deprecated - use `on_finish_action` instead.
:param termination_message_policy: The termination message policy of the base container.
Default value is "File"
:param active_deadline_seconds: The active_deadline_seconds which matches to active_deadline_seconds
:param active_deadline_seconds: The active_deadline_seconds which translates to active_deadline_seconds
in V1PodSpec.
:param progress_callback: Callback function for receiving k8s container logs.
"""
Expand Down
7 changes: 4 additions & 3 deletions kubernetes_tests/test_kubernetes_pod_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1348,12 +1348,13 @@ def __getattr__(self, name):
class TestKubernetesPodOperator(BaseK8STest):
@pytest.mark.parametrize("active_deadline_seconds", [10, 20])
def test_kubernetes_pod_operator_active_deadline_seconds(self, active_deadline_seconds):
ns = "default"
k = KubernetesPodOperator(
task_id=f"test_task_{active_deadline_seconds}",
active_deadline_seconds=active_deadline_seconds,
image="busybox",
cmds=["sh", "-c", "echo 'hello world' && sleep 60"],
namespace="default",
namespace=ns,
on_finish_action="keep_pod",
)

Expand All @@ -1362,11 +1363,11 @@ def test_kubernetes_pod_operator_active_deadline_seconds(self, active_deadline_s
with pytest.raises(AirflowException):
k.execute(context)

pod = k.find_pod("default", context, exclude_checked=False)
pod = k.find_pod(ns, context, exclude_checked=False)

k8s_client = client.CoreV1Api()

pod_status = k8s_client.read_namespaced_pod_status(name=pod.metadata.name, namespace="default")
pod_status = k8s_client.read_namespaced_pod_status(name=pod.metadata.name, namespace=ns)
phase = pod_status.status.phase
reason = pod_status.status.reason

Expand Down