Lee-W commented on code in PR #52051:
URL: https://github.com/apache/airflow/pull/52051#discussion_r2414871445


##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/utils/xcom_sidecar.py:
##########
@@ -29,11 +30,13 @@ class PodDefaults:
     XCOM_MOUNT_PATH = "/airflow/xcom"
     SIDECAR_CONTAINER_NAME = "airflow-xcom-sidecar"
     XCOM_CMD = 'trap "exit 0" INT; while true; do sleep 1; done;'
-    VOLUME_MOUNT = k8s.V1VolumeMount(name="xcom", mount_path=XCOM_MOUNT_PATH)
-    VOLUME = k8s.V1Volume(name="xcom", empty_dir=k8s.V1EmptyDirVolumeSource())
+    VOLUME_MOUNT_NAME = "xcom"
+    VOLUME_MOUNT = k8s.V1VolumeMount(name=VOLUME_MOUNT_NAME, 
mount_path=XCOM_MOUNT_PATH)
+    XCOM_SIDECAR_COMMAND = ["sh", "-c", XCOM_CMD]
+    VOLUME = k8s.V1Volume(name=VOLUME_MOUNT_NAME, 
empty_dir=k8s.V1EmptyDirVolumeSource())

Review Comment:
   ```suggestion
       XCOM_SIDECAR_COMMAND = ["sh", "-c", XCOM_CMD]
       VOLUME_MOUNT_NAME = "xcom"
       VOLUME_MOUNT = k8s.V1VolumeMount(name=VOLUME_MOUNT_NAME, 
mount_path=XCOM_MOUNT_PATH)
       VOLUME = k8s.V1Volume(name=VOLUME_MOUNT_NAME, 
empty_dir=k8s.V1EmptyDirVolumeSource())
   ```
   
   let's group similar concepts together



##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/utils/xcom_sidecar.py:
##########
@@ -46,14 +49,20 @@ class PodDefaults:
 
 
 def add_xcom_sidecar(
-    pod: k8s.V1Pod,
+    pod: k8s.V1Pod | dict,

Review Comment:
   ```suggestion
       pod: k8s.V1Pod | dict[str, Any],
   ```



##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/utils/xcom_sidecar.py:
##########
@@ -64,3 +73,27 @@ def add_xcom_sidecar(
     pod_cp.spec.containers.append(sidecar)
 
     return pod_cp
+
+
+def add_sidecar_to_spark_operator_pod_spec(
+    spec: dict, sidecar_container_image: str | None = None, 
sidecar_container_resources: dict | None = None
+):

Review Comment:
   ```suggestion
   def add_sidecar_to_spark_operator_pod_spec(
       spec: dict[str, Any], sidecar_container_image: str | None = None, 
sidecar_container_resources: dict[str, Any] | None = None
   ) -> dict[str, Any]:
   ```
   
   please confirm whether these type are correct. 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to