Skip to content

PostStart event to execute commands into a container #629

@benoitf

Description

@benoitf

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions