You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "AlejandroMorgante (via GitHub)" <gi...@apache.org> on 2026/09/05 21:29:57 UTC

[PR] Add GKEPodExecOperator for existing Pods [airflow]

AlejandroMorgante opened a new pull request, #72577:
URL: https://github.com/apache/airflow/pull/72577

   Add `GKEPodExecOperator` to execute commands in running containers of existing GKE Pods. The operator reuses `KubernetesPodExecOperator` for execution while the existing GKE mixin supplies Google Cloud authentication, impersonation, cluster discovery, and public, internal, or DNS endpoint selection.
   
   Unlike `GKEStartPodOperator`, this operator does not create, restart, or delete the Pod. This supports workloads whose lifecycle is owned by another platform while avoiding the external `kubectl`, kubeconfig, and shell setup otherwise needed from Airflow.
   
   This builds on https://github.com/apache/airflow/pull/71244.
   
   Validation:
   
   - 103 Google Kubernetes Engine operator unit tests passed.
   - Focused mypy and scoped pre-commit/manual checks passed.
   - The real GKE system test is pending: the local runner stopped during test setup because the shared
     `system.openlineage` test module was not available, before the Dag or any GCP resource was executed.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Codex (GPT-5)
   
   Generated-by: Codex (GPT-5) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add GKEPodExecOperator for existing Pods [airflow]

Posted by "AlejandroMorgante (via GitHub)" <gi...@apache.org>.
AlejandroMorgante commented on PR #72577:
URL: https://github.com/apache/airflow/pull/72577#issuecomment-5559013655

   I also validated the operator end-to-end against a live GKE cluster. Airflow connected to the cluster, executed dbt build inside an existing running Pod, streamed the command output, and waited for completion. The task completed successfully with PASS=3 and ERROR=0, while the Pod remained running without restarts.
   
   <img width="3002" height="1282" alt="image" src="https://github.com/user-attachments/assets/a1dfc14e-38d2-48f0-bb1a-c023260c5544" />
   
   <img width="3024" height="1626" alt="image" src="https://github.com/user-attachments/assets/0ab31b25-4d31-4346-8d2e-2e247d3a86ff" />
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add GKEPodExecOperator for existing Pods [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #72577:
URL: https://github.com/apache/airflow/pull/72577#discussion_r3999096240


##########
providers/google/src/airflow/providers/google/cloud/operators/kubernetes_engine.py:
##########
@@ -688,6 +689,110 @@ def execute(self, context: Context):
             )
 
 
+class GKEPodExecOperator(GKEOperatorMixin, KubernetesPodExecOperator):
+    """
+    Execute a command in a running container of an existing Pod on Google Kubernetes Engine.
+
+    The operator authenticates with Google Cloud and delegates command execution to
+    :class:`~airflow.providers.cncf.kubernetes.operators.pod_exec.KubernetesPodExecOperator`.
+    It does not create, restart, or delete the target Pod.
+
+    .. seealso::
+        For more information on how to use this operator, take a look at the guide:
+        :ref:`howto/operator:GKEPodExecOperator`
+
+    :param location: The Google Kubernetes Engine zone or region in which the cluster resides.
+        (templated)
+    :param cluster_name: The name of the Google Kubernetes Engine cluster. (templated)
+    :param pod_name: Name of the existing Kubernetes Pod. (templated)
+    :param command: Command and arguments to execute in the container. (templated)
+    :param namespace: Namespace containing the Pod. Defaults to ``default``. (templated)
+    :param container_name: Name of the container in which to execute the command. When omitted, the
+        ``kubectl.kubernetes.io/default-container`` annotation or the first container is used.
+        Defaults to ``None``. (templated)
+    :param use_internal_ip: Use the internal IP address as the endpoint. Defaults to ``False``.
+        (templated)
+    :param use_dns_endpoint: Use the DNS address as the endpoint. Defaults to ``False``. This must be
+        set to ``True`` for Sovereign Cloud from Google. (templated)
+    :param project_id: The Google Cloud project ID. Defaults to the project inferred from the Google
+        Cloud connection. (templated)
+    :param gcp_conn_id: The Google Cloud connection ID to use. Defaults to ``google_cloud_default``.
+        (templated)
+    :param impersonation_chain: Optional service account to impersonate using short-term credentials,
+        or a sequence of accounts required to impersonate the final account. Defaults to ``None``.
+        (templated)
+    :param do_xcom_push: Return standard output through XCom when ``True``. Defaults to ``False``.
+    :param max_xcom_output_size: Maximum UTF-8 byte size retained for XCom. Defaults to 49,344 bytes.
+    """
+
+    template_fields: Sequence[str] = tuple(
+        set(GKEOperatorMixin.template_fields)
+        | (
+            set(KubernetesPodExecOperator.template_fields)
+            - {"cluster_context", "config_file", "kubernetes_conn_id"}
+        )
+    )
+    operator_extra_links = (KubernetesEnginePodLink(),)
+
+    def __init__(
+        self,
+        *,
+        location: str,
+        cluster_name: str,
+        pod_name: str,
+        command: Sequence[str],
+        namespace: str = "default",
+        container_name: str | None = None,
+        use_internal_ip: bool = False,
+        use_dns_endpoint: bool = False,
+        project_id: str = PROVIDE_PROJECT_ID,
+        gcp_conn_id: str = "google_cloud_default",
+        impersonation_chain: str | Sequence[str] | None = None,
+        **kwargs,
+    ) -> None:
+        config_file = kwargs.pop("config_file", None)
+        if config_file is not None:
+            raise ValueError(
+                "`config_file` is not allowed for GKEPodExecOperator because authentication is managed "
+                "through `gcp_conn_id`."
+            )
+        if gcp_conn_id is None:
+            raise ValueError(
+                "`gcp_conn_id` must not be None. To use Application Default Credentials, configure an "
+                "empty `google_cloud_default` connection."
+            )
+        super().__init__(
+            pod_name=pod_name,
+            command=command,
+            namespace=namespace,
+            container_name=container_name,
+            kubernetes_conn_id=None,

Review Comment:
   Nit: `config_file` gets a clean `ValueError` just above, but the three sibling parameters that are forced the same way don't — they collide with the explicit keywords here and surface an internal-looking error:
   
   ```
   kubernetes_conn_id -> TypeError: ...KubernetesPodExecOperator.__init__() got multiple values for keyword argument 'kubernetes_conn_id'
           in_cluster -> TypeError: ... 'in_cluster'
      cluster_context -> TypeError: ... 'cluster_context'
          config_file -> ValueError: `config_file` is not allowed for GKEPodExecOperator because authentication is managed through `gcp_conn_id`.
   ```
   
   Someone migrating a `KubernetesPodExecOperator` task over to GKE hits a `TypeError` naming the parent class. Rejecting all four through the same path — or just naming them in the existing `config_file` message — would be more consistent.
   
   ---
   Drafted-by: Claude Opus 5; reviewed by @potiuk before posting
   



##########
providers/google/tests/unit/google/cloud/operators/test_kubernetes_engine.py:
##########
@@ -825,6 +827,104 @@ def test_execute_not_scalable(self, mock_hook, mock_link, mock_super, mock_log):
         )
 
 
+class TestGKEPodExecOperator:
+    def setup_method(self):
+        self.operator = GKEPodExecOperator(
+            task_id=TEST_TASK_ID,
+            project_id=TEST_PROJECT_ID,
+            location=TEST_LOCATION,
+            cluster_name=GKE_CLUSTER_NAME,
+            pod_name=K8S_POD_NAME,
+            namespace=K8S_NAMESPACE,
+            container_name="worker",

Review Comment:
   Nit: `setup_method` always passes `namespace` explicitly, so nothing pins the default. `GKEPodExecOperator` narrows the parent's `namespace: str | None = None` to `namespace: str = "default"` and the docstring advertises that — worth one assertion on an operator built without `namespace`.
   
   Related, no action needed: because this namespace is also what `_resolve_namespace()` returns, `test_execute_persists_link_and_returns_output` can't distinguish resolved from raw. The assertion is a little weaker than it looks.
   
   ---
   Drafted-by: Claude Opus 5; reviewed by @potiuk before posting
   



##########
providers/google/tests/system/google/cloud/kubernetes_engine/example_kubernetes_engine.py:
##########
@@ -49,11 +59,60 @@
 CLUSTER_NAME_BASE = f"cluster-{DAG_ID}".replace("_", "-")
 CLUSTER_NAME_FULL = CLUSTER_NAME_BASE + f"-{ENV_ID}".replace("_", "-")
 CLUSTER_NAME = CLUSTER_NAME_BASE if len(CLUSTER_NAME_FULL) >= 33 else CLUSTER_NAME_FULL
+EXEC_POD_NAME = "existing-pod"
+EXEC_CONTAINER_NAME = "main"
+EXPECTED_EXEC_OUTPUT = "command executed in existing GKE Pod"
 
 # [START howto_operator_gcp_gke_create_cluster_definition]
 CLUSTER = {"name": CLUSTER_NAME, "initial_node_count": 1, "autopilot": {"enabled": True}}
 # [END howto_operator_gcp_gke_create_cluster_definition]
 
+EXEC_POD = f"""
+apiVersion: v1
+kind: Pod
+metadata:
+  name: {EXEC_POD_NAME}
+  namespace: default
+spec:
+  restartPolicy: Never
+  containers:
+    - name: {EXEC_CONTAINER_NAME}
+      image: busybox:1.38.0
+      command: ["sleep", "3600"]
+"""
+
+
+@task.sensor(poke_interval=10, timeout=300, mode="reschedule")
+def wait_for_running_exec_pod() -> bool:

Review Comment:
   Nit: this sensor hand-rolls the GKE auth handshake (`GKEClusterAuthDetails` + `GKEKubernetesHook`) and imports `container_is_running` from `airflow.providers.cncf.kubernetes.utils.container` — a `utils` module rather than documented public interface.
   
   The wait itself is clearly needed (`GKECreateCustomResourceOperator` doesn't block until Running, and the exec operator requires a Running Pod), so this is style only — but this file doubles as the docs source, and the sensor is the largest single block the PR adds to it.
   
   ---
   Drafted-by: Claude Opus 5; reviewed by @potiuk before posting
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add GKEPodExecOperator for existing Pods [airflow]

Posted by "shahar1 (via GitHub)" <gi...@apache.org>.
shahar1 merged PR #72577:
URL: https://github.com/apache/airflow/pull/72577


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add GKEPodExecOperator for existing Pods [airflow]

Posted by "AlejandroMorgante (via GitHub)" <gi...@apache.org>.
AlejandroMorgante commented on code in PR #72577:
URL: https://github.com/apache/airflow/pull/72577#discussion_r4086893726


##########
providers/google/src/airflow/providers/google/cloud/operators/kubernetes_engine.py:
##########
@@ -688,6 +689,110 @@ def execute(self, context: Context):
             )
 
 
+class GKEPodExecOperator(GKEOperatorMixin, KubernetesPodExecOperator):
+    """
+    Execute a command in a running container of an existing Pod on Google Kubernetes Engine.
+
+    The operator authenticates with Google Cloud and delegates command execution to
+    :class:`~airflow.providers.cncf.kubernetes.operators.pod_exec.KubernetesPodExecOperator`.
+    It does not create, restart, or delete the target Pod.
+
+    .. seealso::
+        For more information on how to use this operator, take a look at the guide:
+        :ref:`howto/operator:GKEPodExecOperator`
+
+    :param location: The Google Kubernetes Engine zone or region in which the cluster resides.
+        (templated)
+    :param cluster_name: The name of the Google Kubernetes Engine cluster. (templated)
+    :param pod_name: Name of the existing Kubernetes Pod. (templated)
+    :param command: Command and arguments to execute in the container. (templated)
+    :param namespace: Namespace containing the Pod. Defaults to ``default``. (templated)
+    :param container_name: Name of the container in which to execute the command. When omitted, the
+        ``kubectl.kubernetes.io/default-container`` annotation or the first container is used.
+        Defaults to ``None``. (templated)
+    :param use_internal_ip: Use the internal IP address as the endpoint. Defaults to ``False``.
+        (templated)
+    :param use_dns_endpoint: Use the DNS address as the endpoint. Defaults to ``False``. This must be
+        set to ``True`` for Sovereign Cloud from Google. (templated)
+    :param project_id: The Google Cloud project ID. Defaults to the project inferred from the Google
+        Cloud connection. (templated)
+    :param gcp_conn_id: The Google Cloud connection ID to use. Defaults to ``google_cloud_default``.
+        (templated)
+    :param impersonation_chain: Optional service account to impersonate using short-term credentials,
+        or a sequence of accounts required to impersonate the final account. Defaults to ``None``.
+        (templated)
+    :param do_xcom_push: Return standard output through XCom when ``True``. Defaults to ``False``.
+    :param max_xcom_output_size: Maximum UTF-8 byte size retained for XCom. Defaults to 49,344 bytes.
+    """
+
+    template_fields: Sequence[str] = tuple(
+        set(GKEOperatorMixin.template_fields)
+        | (
+            set(KubernetesPodExecOperator.template_fields)
+            - {"cluster_context", "config_file", "kubernetes_conn_id"}
+        )
+    )
+    operator_extra_links = (KubernetesEnginePodLink(),)
+
+    def __init__(
+        self,
+        *,
+        location: str,
+        cluster_name: str,
+        pod_name: str,
+        command: Sequence[str],
+        namespace: str = "default",
+        container_name: str | None = None,
+        use_internal_ip: bool = False,
+        use_dns_endpoint: bool = False,
+        project_id: str = PROVIDE_PROJECT_ID,
+        gcp_conn_id: str = "google_cloud_default",
+        impersonation_chain: str | Sequence[str] | None = None,
+        **kwargs,
+    ) -> None:
+        config_file = kwargs.pop("config_file", None)
+        if config_file is not None:
+            raise ValueError(
+                "`config_file` is not allowed for GKEPodExecOperator because authentication is managed "
+                "through `gcp_conn_id`."
+            )
+        if gcp_conn_id is None:
+            raise ValueError(
+                "`gcp_conn_id` must not be None. To use Application Default Credentials, configure an "
+                "empty `google_cloud_default` connection."
+            )
+        super().__init__(
+            pod_name=pod_name,
+            command=command,
+            namespace=namespace,
+            container_name=container_name,
+            kubernetes_conn_id=None,

Review Comment:
   Done, thank you! `kubernetes_conn_id`, `in_cluster`, and `cluster_context` now raise a clear ValueError too.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add GKEPodExecOperator for existing Pods [airflow]

Posted by "VladaZakharova (via GitHub)" <gi...@apache.org>.
VladaZakharova commented on code in PR #72577:
URL: https://github.com/apache/airflow/pull/72577#discussion_r4080648020


##########
providers/google/tests/system/google/cloud/kubernetes_engine/example_kubernetes_engine.py:
##########
@@ -49,11 +59,60 @@
 CLUSTER_NAME_BASE = f"cluster-{DAG_ID}".replace("_", "-")
 CLUSTER_NAME_FULL = CLUSTER_NAME_BASE + f"-{ENV_ID}".replace("_", "-")
 CLUSTER_NAME = CLUSTER_NAME_BASE if len(CLUSTER_NAME_FULL) >= 33 else CLUSTER_NAME_FULL
+EXEC_POD_NAME = "existing-pod"

Review Comment:
   The name of the pod here should be unique, try passing env_id or other unique set of values 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add GKEPodExecOperator for existing Pods [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on code in PR #72577:
URL: https://github.com/apache/airflow/pull/72577#discussion_r3999087470


##########
providers/google/pyproject.toml:
##########
@@ -160,7 +160,7 @@ dependencies = [
 # Any change in the dependencies is preserved when the file is regenerated
 [project.optional-dependencies]
 "cncf.kubernetes" = [
-    "apache-airflow-providers-cncf-kubernetes>=10.1.0",
+    "apache-airflow-providers-cncf-kubernetes>=10.1.0",  # use next version

Review Comment:
   The bound needs to actually move here, not just pick up a comment — `>=10.22.0`:
   
   ```toml
   "apache-airflow-providers-cncf-kubernetes>=10.22.0",
   ```
   
   `KubernetesPodExecOperator` landed in cncf-kubernetes 10.22.0 (#71244), but the import at `kubernetes_engine.py:39` is unconditional and at module scope. With the bound left at `>=10.1.0`, any resolver-permitted version in 10.1.0–10.21.1 makes the *whole* module unimportable — `GKEStartPodOperator`, `GKEStartJobOperator`, `GKECreateClusterOperator` and the rest, not just the new operator.
   
   Confirmed by blocking only that submodule via a `sys.meta_path` finder:
   
   ```
   this branch:  ImportError: No module named 'airflow.providers.cncf.kubernetes.operators.pod_exec'
   main:         imports fine
   ```
   
   Worth doing alongside the bump: guard the import with `AirflowOptionalProviderFeatureException`, the way this module already does for `KubernetesDeleteJobOperator` a few lines below. That keeps a separately-installed, mismatched cncf-kubernetes from taking down every GKE operator rather than just the new one.
   
   Process note: 10.22.0 is tagged as `10.22.0rc1` but not yet on PyPI, so let's hold the merge until the release lands.
   
   ---
   Drafted-by: Claude Opus 5; reviewed by @potiuk before posting
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add GKEPodExecOperator for existing Pods [airflow]

Posted by "AlejandroMorgante (via GitHub)" <gi...@apache.org>.
AlejandroMorgante commented on code in PR #72577:
URL: https://github.com/apache/airflow/pull/72577#discussion_r4085851335


##########
providers/google/pyproject.toml:
##########
@@ -160,7 +160,7 @@ dependencies = [
 # Any change in the dependencies is preserved when the file is regenerated
 [project.optional-dependencies]
 "cncf.kubernetes" = [
-    "apache-airflow-providers-cncf-kubernetes>=10.1.0",
+    "apache-airflow-providers-cncf-kubernetes>=10.1.0",  # use next version

Review Comment:
   Done! I applied the same strategy that we use in KubernetesDeleteJobOperator
   
   ---
   Drafted-by: Codex (GPT-5) (no human review before posting)



##########
providers/google/pyproject.toml:
##########
@@ -160,7 +160,7 @@ dependencies = [
 # Any change in the dependencies is preserved when the file is regenerated
 [project.optional-dependencies]
 "cncf.kubernetes" = [
-    "apache-airflow-providers-cncf-kubernetes>=10.1.0",
+    "apache-airflow-providers-cncf-kubernetes>=10.1.0",  # use next version

Review Comment:
   Done! I applied the same strategy that we use in KubernetesDeleteJobOperato



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add GKEPodExecOperator for existing Pods [airflow]

Posted by "AlejandroMorgante (via GitHub)" <gi...@apache.org>.
AlejandroMorgante commented on code in PR #72577:
URL: https://github.com/apache/airflow/pull/72577#discussion_r4085851335


##########
providers/google/pyproject.toml:
##########
@@ -160,7 +160,7 @@ dependencies = [
 # Any change in the dependencies is preserved when the file is regenerated
 [project.optional-dependencies]
 "cncf.kubernetes" = [
-    "apache-airflow-providers-cncf-kubernetes>=10.1.0",
+    "apache-airflow-providers-cncf-kubernetes>=10.1.0",  # use next version

Review Comment:
   Done! I applied the same strategy that we use in `KubernetesDeleteJobOperator`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add GKEPodExecOperator for existing Pods [airflow]

Posted by "AlejandroMorgante (via GitHub)" <gi...@apache.org>.
AlejandroMorgante commented on code in PR #72577:
URL: https://github.com/apache/airflow/pull/72577#discussion_r4086806897


##########
providers/google/tests/unit/google/cloud/operators/test_kubernetes_engine.py:
##########
@@ -825,6 +827,104 @@ def test_execute_not_scalable(self, mock_hook, mock_link, mock_super, mock_log):
         )
 
 
+class TestGKEPodExecOperator:
+    def setup_method(self):
+        self.operator = GKEPodExecOperator(
+            task_id=TEST_TASK_ID,
+            project_id=TEST_PROJECT_ID,
+            location=TEST_LOCATION,
+            cluster_name=GKE_CLUSTER_NAME,
+            pod_name=K8S_POD_NAME,
+            namespace=K8S_NAMESPACE,
+            container_name="worker",

Review Comment:
   Done! I added a test that creates `GKEPodExecOperator` without specifying namespace and asserts that it defaults to default. Thanks!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add GKEPodExecOperator for existing Pods [airflow]

Posted by "AlejandroMorgante (via GitHub)" <gi...@apache.org>.
AlejandroMorgante commented on code in PR #72577:
URL: https://github.com/apache/airflow/pull/72577#discussion_r4087146982


##########
providers/google/tests/system/google/cloud/kubernetes_engine/example_kubernetes_engine.py:
##########
@@ -49,11 +59,60 @@
 CLUSTER_NAME_BASE = f"cluster-{DAG_ID}".replace("_", "-")
 CLUSTER_NAME_FULL = CLUSTER_NAME_BASE + f"-{ENV_ID}".replace("_", "-")
 CLUSTER_NAME = CLUSTER_NAME_BASE if len(CLUSTER_NAME_FULL) >= 33 else CLUSTER_NAME_FULL
+EXEC_POD_NAME = "existing-pod"
+EXEC_CONTAINER_NAME = "main"
+EXPECTED_EXEC_OUTPUT = "command executed in existing GKE Pod"
 
 # [START howto_operator_gcp_gke_create_cluster_definition]
 CLUSTER = {"name": CLUSTER_NAME, "initial_node_count": 1, "autopilot": {"enabled": True}}
 # [END howto_operator_gcp_gke_create_cluster_definition]
 
+EXEC_POD = f"""
+apiVersion: v1
+kind: Pod
+metadata:
+  name: {EXEC_POD_NAME}
+  namespace: default
+spec:
+  restartPolicy: Never
+  containers:
+    - name: {EXEC_CONTAINER_NAME}
+      image: busybox:1.38.0
+      command: ["sleep", "3600"]
+"""
+
+
+@task.sensor(poke_interval=10, timeout=300, mode="reschedule")
+def wait_for_running_exec_pod() -> bool:

Review Comment:
   Good point, thanks! This follows the existing Kubernetes PodExec system test, including the utils import. Since this is a style nit, I’d leave an API cleanup for a separate PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add GKEPodExecOperator for existing Pods [airflow]

Posted by "AlejandroMorgante (via GitHub)" <gi...@apache.org>.
AlejandroMorgante commented on PR #72577:
URL: https://github.com/apache/airflow/pull/72577#issuecomment-5802743460

   All done. Thank you for your feedback!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Add GKEPodExecOperator for existing Pods [airflow]

Posted by "AlejandroMorgante (via GitHub)" <gi...@apache.org>.
AlejandroMorgante commented on code in PR #72577:
URL: https://github.com/apache/airflow/pull/72577#discussion_r4084655701


##########
providers/google/tests/system/google/cloud/kubernetes_engine/example_kubernetes_engine.py:
##########
@@ -49,11 +59,60 @@
 CLUSTER_NAME_BASE = f"cluster-{DAG_ID}".replace("_", "-")
 CLUSTER_NAME_FULL = CLUSTER_NAME_BASE + f"-{ENV_ID}".replace("_", "-")
 CLUSTER_NAME = CLUSTER_NAME_BASE if len(CLUSTER_NAME_FULL) >= 33 else CLUSTER_NAME_FULL
+EXEC_POD_NAME = "existing-pod"

Review Comment:
   Done! Thanks 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org