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

   ### Apache Airflow version
   
   Other Airflow 2 version (please specify below)
   
   ### What happened
   
   I have a bash sensor defined as follows:
   
   ```python
   foo_sensor_task = BashSensor(
       task_id="foo_task",
       poke_interval=3600,
       bash_command="python -m foo.run",
       retries=0,
       executor_config={
           "pod_template_file: "path-to-file-yaml",
           "pod_override": k8s.V1Pod(
                 spec=k8s.V1PodSpec(
                     containers=[
                         k8s.V1Container(name="base, image="foo-image", 
args=["abc"])
                     ]
                 )
           )
       }
   )
   ```
   
   Entrypoint command in the `foo-image` is `python -m foo.run`. However, when 
I deploy the image onto Openshift (Kubernetes), the command somehow turns out 
to be the following:
   
   ```bash
   python -m foo.run airflow tasks run foo_dag foo_sensor_task 
manual__2022-10-28T21:08:39+00:00 ...
   ```
   
   which is wrong.
   
   ### What you think should happen instead
   
   I assume the expected command should override `args` (see V1Container `args` 
value above) and therefore should be:
   
   ```bash
   python -m foo.run abc
   ```
   
   and **not**:
   ```bash
   python -m foo.run airflow tasks run foo_dag foo_sensor_task 
manual__2022-10-28T21:08:39+00:00 ...
   ```
   
   
   ### How to reproduce
   
   To reproduce the above issue, create a simple DAG and a sensor as defined 
above. Use a sample image and try to override the args. I cannot provide the 
same code due to NDA.
   
   ### Operating System
   
   RHLS 7.9
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-amazon==2.4.0
   apache-airflow-providers-cncf-kubernetes==2.1.0
   apache-airflow-providers-ftp==2.0.1
   apache-airflow-providers-http==2.0.1
   apache-airflow-providers-imap==2.0.1
   apache-airflow-providers-mysql==2.1.1
   apache-airflow-providers-sqlite==2.0.1
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   N/A
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] 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