odo icon indicating copy to clipboard operation
odo copied to clipboard

postStop lifecycle event support

Open upLukeWeston opened this issue 4 years ago • 8 comments

User Story

As a stack creator, I want to be able to define commands that will be executed after my component has been deleted as a part of odo delete (postStop events)

Acceptance Criteria

  • It should follow the specification as defined in devfile/kubernetes-api#32 to support execution of the commands based on the events.
  • postStop events should run after the component has been deleted. Refer to design and discussions here for further details.

Links

/kind user-story /area devfile

upLukeWeston avatar Jul 15 '20 09:07 upLukeWeston

will check if we need this issue or it can be covered by parent issue https://github.com/openshift/odo/issues/3569 in a single sprint

maysunfaisal avatar Jul 16 '20 15:07 maysunfaisal

Had discussion about this on Jul 21'st odo contributors meeting https://docs.google.com/document/d/127JAIs5NJze9W5yVOpULgnD-2HXuGZu1x6_LXGd8keY

To summarize,

Q. How will postStop work in odo? There is no pod/container to work with. odo proposal doc says postStop should be executed as a standalone container/job but odo delete, deletes the deployment which will result in termination of all Kube resources owned by the deployment

A. Should be a job, that is blocking because users need to know the output. Check how the UX is if odo delete is blocking with postStop and consider the --wait flag. Also check if the job can delete itself after completion

maysunfaisal avatar Jul 22 '20 18:07 maysunfaisal

Moving this back to pipeline To do since there is a discussion going on about preStart event here in https://github.com/devfile/api/issues/105 and may probably affect postStop

maysunfaisal avatar Aug 13 '20 19:08 maysunfaisal

Need to wait for the devfile-api issue.

elsony avatar Aug 18 '20 17:08 elsony

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot avatar Nov 16 '20 20:11 openshift-bot

I think the issue is still very relevant. The issue on devfile-api repo has been closed as well.

/remove-lifecycle stale /lifecycle frozen

dharmit avatar Nov 17 '20 04:11 dharmit

How will odo react to the components created by apply command of postStop events? Does odo delete them on exiting odo dev command, or does it leave up to user to decide when to delete them? TBD in devfile cabal.

For exec commands, we can create k8s Jobs.

valaparthvi avatar Jul 14 '22 13:07 valaparthvi

Based on discussion in the devfile cabal resources created for apply command would be fire and forget from odo perspective. It's up to the user to delete these because odo can't assume to delete such resources.

dharmit avatar Jul 18 '22 13:07 dharmit