You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "abmramirez (via GitHub)" <gi...@apache.org> on 2024/08/13 08:06:08 UTC

[I] Error when you pass string arguments with white spaces on kubernetes pod operator [airflow]

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

   ### Apache Airflow version
   
   Other Airflow 2 version (please specify below)
   
   ### If "Other Airflow 2 version" selected, which one?
   
   2.9.2
   
   ### What happened?
   
   When you pass arguments with white spaces on a kubernetes pod operator, a carriage return is added after each whitespace on the rendered template and the operator reads each line as distinct params. We tested this on 2.9.2 and previous versions. The same happens with apache-airflow-providers-cncf-kubernetes 8.3.1 and previous version.
   For example: 
   
   if the argument is: {"data": "value with spaces"}
   
   The rendered template prints this:
   
   '--data',
   '{"data": "value '
   'with '
   'spaces"}'
   
   
   But it should be like this:
   '--data',
   '{"data": "value with spaces"}'
   
   
   ### What you think should happen instead?
   
   The rendered template should not add a return carriage after white spaces
   
   ### How to reproduce
   
   Passing arguments with a whitespace on a kubernetes pod operator
   
   ### Operating System
   
   Ubuntu 22.04 container
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow==2.9.2
   apache-airflow-providers-cncf-kubernetes 8.3.1
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   airflow install on linux box.
   
   ### 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: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Error when you pass string arguments with white spaces on kubernetes pod operator [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #41419: Error when you pass string arguments with white spaces on kubernetes pod operator
URL: https://github.com/apache/airflow/issues/41419


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Error when you pass string arguments with white spaces on kubernetes pod operator [airflow]

Posted by "abmramirez (via GitHub)" <gi...@apache.org>.
abmramirez commented on issue #41419:
URL: https://github.com/apache/airflow/issues/41419#issuecomment-2320577346

   > @abmramirez you might want to ensure that the arguments are properly escaped or quoted. Does the following work for you?
   > 
   > ```
   > task = KubernetesPodOperator(
   >     task_id='example_task',
   >     namespace='default',
   >     image='your-image',
   >     cmds=["/bin/bash", "-c"],
   >     arguments=['--data', '{"data": "value with spaces"}'],
   >     name='example-pod',
   >     in_cluster=True,
   >     is_delete_operator_pod=True,
   >     get_logs=True,
   > )
   > ```
   Hi,
   
   That is how we are sending the parameters and the error still occurs.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Error when you pass string arguments with white spaces on kubernetes pod operator [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #41419:
URL: https://github.com/apache/airflow/issues/41419#issuecomment-2364773277

   This issue has been closed because it has not received response from the issue author.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Error when you pass string arguments with white spaces on kubernetes pod operator [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #41419:
URL: https://github.com/apache/airflow/issues/41419#issuecomment-2285617980

   Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Error when you pass string arguments with white spaces on kubernetes pod operator [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #41419:
URL: https://github.com/apache/airflow/issues/41419#issuecomment-2350730810

   This issue has been automatically marked as stale because it has been open for 14 days with no response from the author. It will be closed in next 7 days if no further activity occurs from the issue author.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Error when you pass string arguments with white spaces on kubernetes pod operator [airflow]

Posted by "sunank200 (via GitHub)" <gi...@apache.org>.
sunank200 commented on issue #41419:
URL: https://github.com/apache/airflow/issues/41419#issuecomment-2295423563

   @abmramirez you might want to ensure that the arguments are properly escaped or quoted. Does the following work for you?
   ```
   task = KubernetesPodOperator(
       task_id='example_task',
       namespace='default',
       image='your-image',
       cmds=["/bin/bash", "-c"],
       arguments=['--data', '{"data": "value with spaces"}'],
       name='example-pod',
       in_cluster=True,
       is_delete_operator_pod=True,
       get_logs=True,
   )
   ```


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org