jupyterhub / kubespawner

Kubernetes spawner for JupyterHub
https://jupyterhub-kubespawner.readthedocs.io
BSD 3-Clause "New" or "Revised" License
536 stars 301 forks source link

kubespawner removes doubledash("--") from extra_containers command arguments #765

Closed dashwin82 closed 11 months ago

dashwin82 commented 11 months ago

Bug description

I am trying to configure kubespawner.extra_containers, to add additional containers to our Jypyterlab singe user pods. If the container arguments contains "--" as inputs, then kubespawner strips and replace with "" For example, the input to kubespawner.extra_containers is as below [{'name': 'logshipper', 'imagePullPolicy': 'IfNotPresent', 'image': 'logshipper', 'args': ['stdout-redirect', '-redirect=file', '-size=2', '-rotate=5', '-logfile=/logs/logshipper.log', '--', '/opt/fluent-bit/scripts/init.sh', '--config=/etc/fluent-bit/fluent-bit.conf']

The spawned pod has the below description `- args:

Expected behaviour

The expected behavior should be as below `- args:

Actual behaviour

Looks like kubespawner makes "--" it to null in generated pod spec

How to reproduce

As example, the jupyterhub chart install, is configured with a sample container `singleuser: extraContainers:

alpine: Container ID: docker://13639077730bf998773f5d2c0dbc71ae035a6e15b38afa3d7ca421148be4bc99 Image: alpine Image ID: docker-pullable://alpine@sha256:7144f7bab3d4c2648d7e59409f15ec52a18006a128c733fcff20d3a4a54ba44a Port: <none> Host Port: <none> Args: touch "" myfile Looking closely, the Args have an empty line, which should have been "--"

welcome[bot] commented 11 months ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

minrk commented 11 months ago

This is because of an overzealous rstrip("-"). Should be fixed by #770.