odo: postStart event not honored when subsequent odo push invoke causes a new pod to start

/kind bug

What versions of software are you using?

Operating System: Windows

Output of odo version:

odo v2.0.0-beta-1 (c19e1f390)
Server: https://api.slobbed.os.fyre.ibm.com:6443
Kubernetes: v1.16.2

How did you run odo exactly?

Actual behavior

I have a postStart event/command defined in my devfile that copies files from the base image to a certain location in the working dir … When I do the first initial odo push, I see it get invoked and the copy happens as expected. If I do a second push, but supply an alternative run command (–run-command <some other command>), the current pod gets destroyed and a new pod starts (because of the new run command supplied I am guessing) - but the postStart event is not honored…does not get invoked in the new pod/container and the copy i expect does not occur.

Expected behavior

On the second (or subsequent) odo push containing a --run-command arg, I would expect the postStart event to be honored in the new pod that is started.

Any logs, error output, etc?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (11 by maintainers)

Most upvoted comments

@adisky Just checked, Odo executes postStart only after a source sync.

saying the same, currently source code is synced before postStart event, we are executing postStart event only once during first odo push.

if we want to execute postStart event whenever a new pod gets created(pod eviction, pod deletion), we need to keep in mind source code should be synced before that.