j-svensmark commented on issue #29002:
URL: https://github.com/apache/airflow/issues/29002#issuecomment-1396358849
Sure, I'm seeing the issue with the following DAG
```
import airflow
import os
import pendulum
from airflow import DAG
from airflow.providers.cncf.kubernetes.operators.kubernetes_pod import
KubernetesPodOperator
local_tz = pendulum.timezone("Asia/Tokyo")
default_task_args = {
"start_date": local_tz.convert(airflow.utils.dates.days_ago(1)),
}
dag = DAG(
"debug_kube_xcom",
default_args=default_task_args,
)
for get_logs in [False, True]:
KubernetesPodOperator(
namespace=os.getenv("KUBE_NAMESPACE"),
image='alpine',
cmds=["sh", "-c", "sleep 3; mkdir -p /airflow/xcom/;echo '[1,2,3,4]'
> /airflow/xcom/return.json"],
name=f"write-xcom-get-logs-{get_logs}",
do_xcom_push=True,
is_delete_operator_pod=True,
in_cluster=True,
task_id=f"write-xcom-get-logs-{get_logs}",
get_logs=get_logs,
dag=dag
)
```
(The namespace line is specific to my setup, so you probably need to change
it if running this)
Here the `write-xcom-get-logs-True` task gets the xcom value, but the
`write-xcom-get-logs-False` fails.
--
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]