Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve custom init_containers #17

Closed
g-braeunlich opened this issue Jun 2, 2021 · 4 comments · Fixed by #18
Closed

Preserve custom init_containers #17

g-braeunlich opened this issue Jun 2, 2021 · 4 comments · Fixed by #18

Comments

@g-braeunlich
Copy link
Contributor

g-braeunlich commented Jun 2, 2021

Would it be possible to not override self.init_containers but only add the project-manager init container in persistent_bhub_config.py?
E.g.

if not any(ic["name"] == "project-manager" for ic in self.init_containers):
    self.init_containers.append({
            "name": "project-manager",
            "image": self.image,
            "command": command,
            # volumes is already defined for notebook container (self.volumes)
            "volume_mounts": [projects_volume_mount],
        })
@MridulS
Copy link
Contributor

MridulS commented Jun 2, 2021

That sounds okay to me, but it would be nice to know/document an example how else is initContainer is being used :)

@g-braeunlich
Copy link
Contributor Author

In my case: I want to automatically do

git config --global user.name ...
git config --global user.email ...

Therefore I would like to subclass PersistentBinderSpawner and add another init container doing that.
I cannot wrap start() and add it afterwards, because at the end of start() the spawning will start.

@MridulS
Copy link
Contributor

MridulS commented Jun 2, 2021

@g-braeunlich jupyterhub/binderhub#1081 looks related?

@g-braeunlich
Copy link
Contributor Author

Yes but in my case, I dont want to modify the image. I want to modify the users persisted volume

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants