ginwakeup opened a new issue, #28489:
URL: https://github.com/apache/airflow/issues/28489

   ### Apache Airflow version
   
   2.5.0
   
   ### What happened
   
   I am trying to use an Operator output, or the DAG config params to 
parametrize the executor_config, but it does not work.
   
   ### What you think should happen instead
   
   It should be possible to send Operators outputs and DAG params to 
executor_config.
   
   ### How to reproduce
   
   Create a DAG with two tasks in a Airflow Cluster setup with Kubernetes 
Executor.
   Generate a string from the first task and use it in the executor_config of 
the second task.
   
   ```python
   @dag(
   ...
       params={
           "venv-name": Param("")
       }
   )
   def createVenv():
   ...
   
       volumeOperator = volume.K8sCreateVolumeOperator(
           task_id="create_volume",
           name="{{ params['venv-name'] }}", 
           executor_config={
               "KubernetesExecutor": {
                   "volume_mounts": [
                       {"name": "kubeconf", "mountPath": "/secrets"}
                   ],
                   "volumes": [
                       {
                           "name": "kubeconf",
                           "secret": {"secretName": 
"airflow-kubeconfig-secret"},
                       }
                   ],
               }
           },
       )
   
       createVenv = BashOperator(
           task_id="create_venv",
           bash_command=f"python -m venv /venvs",
           executor_config={
               "KubernetesExecutor": {
                   "volume_mounts": [
                       {"name": "venv", "mountPath": "/venvs"}
                   ],
                   "volumes": [
                       {
                           "name": "venv",
                           "persistentVolumeClaim": {"claimName": 
"airflow-pvc-{{ params['venv-name'] }}"},
                       }
                   ],
               }
           },
       )
       volumeOperator >> createVenv >> endTask
   
   
   ...
   ```
   
   ### Operating System
   
   Ubuntu20
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   Kubernetes Deployment using HELM chart.
   Airflow set to use Kubernetes Executor.
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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