Passing arguments for command from Options page


I am interested in using GitLab repository as a “starter” template notebooks. Currently, we are using postStart in lifecycle_hooks to run gitpuller on KubeSpawner

However, is it possible to allow users to provide their own Git repository that they wish to use as a template? I have taken a look at Binder and notice that they are passing repo_url in the options.

Currently, we have in values.yml

  - display_name: "Image name"
    description: "Python 3"
              - "sh"
              - "-c"
              - |

We want to provide a text box in the Options form for git url so that user can clone dynamically.

My thinking right now, is to pass repo url from Options form into postStart command but I am not too sure if it is the best approach., or if it is even possible.

Are there any guides to go about this?


Using options form is one way to pass the additional information. Ensure you validate all input, especially if you don’t fully trust all users.

The other option is to take advantage of the ability to set a redirect, and generate a URL to automatically clone after the server is started: Options in an nbgitpuller URL — nbgitpuller documentation