portainer icon indicating copy to clipboard operation
portainer copied to clipboard

fix(stack): fix lifecycle hook from not getting called, issue #12452

Open chris-gputrader opened this issue 10 months ago • 3 comments

closes #12452

Changes:

Added project to api.StartOptions for api.UpOptions in stack Deploy.

chris-gputrader avatar Feb 02 '25 06:02 chris-gputrader

Any movement here. I'm having issues because of this.

joshfrias avatar Mar 11 '25 18:03 joshfrias

@chris-gputrader you did the background research on this on the Docker repo issue. I would suggest cross posting it to help explain how this fix works and to validate the approach. It will help encourage the merge.

maggie44 avatar Mar 14 '25 17:03 maggie44

Sure, as I was digging into the issue I initially thought this had to do with the compose library and created an issue here: https://github.com/docker/compose/issues/12513

After debugging and getting help from the compose community I found out that we had to add Project to the Deploy and Remove functions in the portainer compose plugin.

There is an edge case that I haven't figured out though. This works fine when a stack gets Deployed, or Removed. If a container is restarted these don't trigger because container start/stop/restart don't use the compose plugin.

chris-gputrader avatar Mar 27 '25 22:03 chris-gputrader

Any progress on this PR?

kueronya avatar Jul 21 '25 12:07 kueronya