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

Running multiple postStart events is not allowed. #21903

Closed
MazArslan opened this issue Dec 23, 2022 · 4 comments
Closed

Running multiple postStart events is not allowed. #21903

MazArslan opened this issue Dec 23, 2022 · 4 comments
Labels
kind/bug Outline of a bug - must adhere to the bug report template. status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github.

Comments

@MazArslan
Copy link

Describe the bug

When I try to use multiple post start events, i get an error saying that Error processing devfile: component tools has multiple postStart events attached to it. As per the devfile 2 schema validation, this is a valid syntax, since both, postStart and commands are accepting array of elements.

Che version

7.58@latest

Steps to reproduce

schemaVersion: 2.1.0
metadata:
  name: demo-project
components:
  - name: tools
    container:
      image: quay.io/devfile/universal-developer-image:ubi8-f5ffca8
      memoryRequest: 1Gi
      memoryLimit: 3Gi
      cpuLimit: 1000m
      cpuRequest: 500m
commands:
  - id: second-command
    exec:
      component: tools
      commandLine: "echo second command"
  - id: install
    exec:
      component: tools
      commandLine: "/home/user/.sdkman/candidates/jbang/current/bin/jbang trust add -o --fresh --quiet https://github.com/apache/camel/blob/HEAD/dsl/camel-jbang/camel-jbang-main/dist/CamelJBang.java"
events:
  postStart:
    - install
    - second-command

create 2 commands and use both on a post start

when trying to run use the devfile getting this issue when trying to create workspace
Error processing devfile: component tools has multiple postStart events attached to it

Expected behavior

to apply the both/multiple post start events.

Runtime

OpenShift

Screenshots

No response

Installation method

OperatorHub

Environment

other (please specify in additional context)

Eclipse Che Logs

No response

Additional context

No response

@MazArslan MazArslan added the kind/bug Outline of a bug - must adhere to the bug report template. label Dec 23, 2022
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Dec 23, 2022
@karatkep
Copy link

I guess the issue that you want to run two postStart events for one component.
If you want to run two (or more) postStart events for the one component you can try to split commands by ";". For example:

schemaVersion: 2.1.0
metadata:
  name: demo-project
components:
  - name: tools
    container:
      image: quay.io/devfile/universal-developer-image:ubi8-f5ffca8
      memoryRequest: 1Gi
      memoryLimit: 3Gi
      cpuLimit: 1000m
      cpuRequest: 500m
commands:
  - id: two-commands
    exec:
      component: tools
      commandLine: "/home/user/.sdkman/candidates/jbang/current/bin/jbang trust add -o --fresh --quiet https://github.com/apache/camel/blob/HEAD/dsl/camel-jbang/camel-jbang-main/dist/CamelJBang.java; echo second command"
events:
  postStart:
    - two-commands

@MazArslan
Copy link
Author

That just a workaround, and I have done that. But my issue is in the documentation both command and postStart are Array<string> . This suggests to me that I should be able to have multiple events for one component.
https://devfile.io/docs/2.1.0/devfile-schema#events-post-start

@karatkep
Copy link

karatkep commented Dec 24, 2022

ok, I got you point. You are reporting the issue with devfile processing. Outcome should be either code fix to allow multiple post events per one component processing or documentation update to add proper wording. Sounds reasonable to me.

The only one thing that I want to recommend you - is to use Devfile project to report the issue. Obviously, it's not a Eclipse Che issue. Probably Devworkspace-operator is a good repository to start.

@dkwon17
Copy link
Contributor

dkwon17 commented Jan 4, 2023

Thank you for reporting @MazArslan , closing in favour of devfile/devworkspace-operator#1011

@dkwon17 dkwon17 closed this as completed Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template. status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github.
Projects
None yet
Development

No branches or pull requests

4 participants