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

Odo should use apply command for preStart(and postStop when its implemented) #4187

Closed
maysunfaisal opened this issue Nov 3, 2020 · 2 comments · Fixed by #4405
Closed

Odo should use apply command for preStart(and postStop when its implemented) #4187

maysunfaisal opened this issue Nov 3, 2020 · 2 comments · Fixed by #4405
Assignees
Labels
area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it.

Comments

@maysunfaisal
Copy link
Contributor

maysunfaisal commented Nov 3, 2020

There is a semantic difference between an exec and apply command - exec commands are to be executed only when a container is up and running and apply commands are applied when there is no running container.

However, odo only has exec and composite commands in its scope and preStart utilizes an exec command. But according to the schema definition and interpretation this is not right. See issue devfile/api#204 for discussion.

Currently no odo devfiles have a preStart, so it would be good to update the implementation to use apply commands before a devfile starts using it.

For more information on which events use apply/exec, pls read devfile validation doc - https://github.com/devfile/api/blob/master/pkg/validation/validation-rule.md. Also note the condition for composite commands when it comes to events!

cc: @kadel

@maysunfaisal maysunfaisal added the area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. label Nov 3, 2020
@maysunfaisal
Copy link
Contributor Author

@kadel @dharmit FYI, this issue will be need to be addressed when odo switches validation to devfile library and api as per #4361

There is currently an open PR to consolidate validations in devfile/api#301

@kadel
Copy link
Member

kadel commented Jan 20, 2021

odo currently doesn't support apply commands. This means that odo can't currently support preStart event.
A temporary solution until we have apply support in odo is not to support preStart event. So odo will error out in case of devfile with preStart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants