From 641eb09b4ccc82d18d01de5e84e209274eab7a70 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Fri, 30 Apr 2021 23:42:16 +0100 Subject: [PATCH 1/3] Rewrite docs for Kubespawner.cmd --- kubespawner/spawner.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/kubespawner/spawner.py b/kubespawner/spawner.py index f5e3150c..475208aa 100644 --- a/kubespawner/spawner.py +++ b/kubespawner/spawner.py @@ -403,18 +403,14 @@ def _namespace_default(self): minlen=0, config=True, help=""" - The command used for starting the single-user server. + The command used to start the single-user server. - Provide either a string or a list containing the path to the startup script command. Extra arguments, - other than this path, should be provided via `args`. + Either + - a string containing a single command or path to a startup script + - a list of the command and arguments + - `None` (default) to use the Docker image's `Cmd` - This is usually set if you want to start the single-user server in a different python - environment (with virtualenv/conda) than JupyterHub itself. - - Some spawners allow shell-style expansion here, allowing you to use environment variables. - Most, including the default, do not. Consult the documentation for your spawner to verify! - - If set to `None`, Kubernetes will start the `CMD` that is specified in the Docker image being started. + `cmd` will be passed to the image's `Entrypoint`. """, ) From 898fd4bed87801f24a89a4a14cb9e4886cdb3a7a Mon Sep 17 00:00:00 2001 From: Simon Li Date: Sat, 1 May 2021 13:58:33 +0100 Subject: [PATCH 2/3] Use capitals for container instructions Co-authored-by: Erik Sundell --- kubespawner/spawner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kubespawner/spawner.py b/kubespawner/spawner.py index 475208aa..1c6b219b 100644 --- a/kubespawner/spawner.py +++ b/kubespawner/spawner.py @@ -408,9 +408,9 @@ def _namespace_default(self): Either - a string containing a single command or path to a startup script - a list of the command and arguments - - `None` (default) to use the Docker image's `Cmd` + - `None` (default) to use the Docker image's `CMD` - `cmd` will be passed to the image's `Entrypoint`. + `cmd` will be passed to the image's `ENTRYPOINT`. """, ) From 0df612332c83cd11b952860c134e4a4e258d91d7 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Sat, 1 May 2021 22:06:09 +0200 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Simon Li --- kubespawner/spawner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubespawner/spawner.py b/kubespawner/spawner.py index 1c6b219b..287eb432 100644 --- a/kubespawner/spawner.py +++ b/kubespawner/spawner.py @@ -410,7 +410,7 @@ def _namespace_default(self): - a list of the command and arguments - `None` (default) to use the Docker image's `CMD` - `cmd` will be passed to the image's `ENTRYPOINT`. + If `cmd` is set, it will be augmented with `spawner.get_args(). This will override the `CMD` specified in the Docker image. """, )