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

   `add_xcom_sidecar` deep-copies the input pod so the caller's object stays 
untouched, but it then re-pointed the copy's `spec.volumes` at the **original** 
pod's list before inserting the xcom volume. Any caller reusing the same pod 
object (custom operators, subclasses calling `build_pod_request_obj` more than 
once, direct users of the helper) accumulated one extra `xcom` volume per call, 
and the Kubernetes API rejects the second pod with `Duplicate value: "xcom"`. 
`KubernetesPodOperator` itself was only shielded because `reconcile_pods` 
happens to deep-copy first.
   
   The default `V1Volume` / `V1VolumeMount` were also inserted as the shared 
module-level instances from `PodDefaults`, so mutating them on one pod silently 
changed every other pod built by the helper as well as the defaults themselves.
   
   This PR:
   - assigns `pod_cp.spec.volumes` from the copy rather than the original pod
   - inserts deep copies of `PodDefaults.VOLUME` and `PodDefaults.VOLUME_MOUNT`
   - adds regression tests that fail without the fix
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Fable 5.1)
   
   Generated-by: Claude Code (Fable 5.1) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01NboKVxeuK5WvpXNtmz83GN


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