You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/01/31 08:11:01 UTC

[GitHub] [airflow] mrkm4ntr commented on a change in pull request #20647: Set default value of in_cluster False for GKEStartPodOperator

mrkm4ntr commented on a change in pull request #20647:
URL: https://github.com/apache/airflow/pull/20647#discussion_r795421083



##########
File path: airflow/providers/google/cloud/operators/kubernetes_engine.py
##########
@@ -335,8 +339,16 @@ def __init__(
                 stacklevel=2,
             )
             is_delete_operator_pod = False
+        if in_cluster:
+            warnings.warn(
+                f"You should not set parameter `in_cluster` `True` in class {self.__class__.__name__}. "
+                "This operator uses Google Service Account(GSA) not Kubernetes Service Account(KSA)."
+                "If you can use KSA with in_cluster `True`, you should use KubernetesPodOperator directly.",
+                DeprecationWarning,
+                stacklevel=2,
+            )
 
-        super().__init__(is_delete_operator_pod=is_delete_operator_pod, **kwargs)
+        super().__init__(is_delete_operator_pod=is_delete_operator_pod, in_cluster=in_cluster, **kwargs)

Review comment:
       I cared about the users who are using GKEPodOperator with KSA accidentally. Those users should KubernetesPodOperator instead of GKEPodOperator but I'd not like to introduce a breaking change.
   If we don't have to care about those users, we can just set `in_cluster=False` directly.




-- 
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