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

PostStart event to execute commands into a container #629

Closed
benoitf opened this issue Oct 1, 2021 · 1 comment · Fixed by #659
Closed

PostStart event to execute commands into a container #629

benoitf opened this issue Oct 1, 2021 · 1 comment · Fixed by #659
Assignees
Milestone

Comments

@benoitf
Copy link
Collaborator

benoitf commented Oct 1, 2021

Description

Let's take the example of one simple devfile with one container

schemaVersion: 2.1.0
metadata:
  name: example
components:
  - name: tools
    container:
      image: registry.access.redhat.com/ubi8/ubi-minimal

Today, to start an editor in this container, Che Dashboard through some external libs is patching entrypoint of the component.
It leads to many problems:

  • logic is inside dashboard side (or 3rd party library)
  • devfile is changed so when looking at the result it's hard to know what devfile was used as input.
  • entrypoint is changed
  • we can't use the editor without dashboard

...but I would like to have a cleaner solution where:

  • devfile is kept untouched
  • entrypoint is not overriden
  • it can work on top of DevWorkspaceController without any che-related stuff

So I would like to be able to define a postStart event to run a command ... but this command should be invoked in another container. (Like the first container or another one depending on one possible annotation)

TL;DR:
Add a postStart event inside the DevWorkspaceTemplate telling to execute one command in another container (but not knowing its name as the 'editor' template doesn't know much about the name of the components/containers of the devfile)

Additional context

It would depend on #628

DevWorkspaceTemplate would then:

  • notify to mount a given path in first container (or all)
  • notify to execute a command inside the container
@sleshchenko
Copy link
Member

Investigation is scheduled in #655 if we can use kubernets postStart hook for that

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.

3 participants