detect replacement container is created and inform printer so it attach and don't stop

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2023-02-03 14:36:39 +01:00 committed by Nicolas De loof
parent b3ec110612
commit 0f5b5ccbd0
10 changed files with 97 additions and 43 deletions

View file

@ -468,6 +468,7 @@ type ContainerEvent struct {
// This is only suitable for display purposes within Compose, as it's
// not guaranteed to be unique across services.
Container string
ID string
Service string
Line string
// ContainerEventExit only
@ -484,6 +485,8 @@ const (
ContainerEventAttach
// ContainerEventStopped is a ContainerEvent of type stopped.
ContainerEventStopped
// ContainerEventRecreated let consumer know container stopped but his being replaced
ContainerEventRecreated
// ContainerEventExit is a ContainerEvent of type exit. ExitCode is set
ContainerEventExit
// UserCancel user cancelled compose up, we are stopping containers

View file

@ -55,6 +55,8 @@ const (
VersionLabel = "com.docker.compose.version"
// ImageBuilderLabel stores the builder (classic or BuildKit) used to produce the image.
ImageBuilderLabel = "com.docker.compose.image.builder"
// ContainerReplaceLabel is set when container is created to replace another container (recreated)
ContainerReplaceLabel = "com.docker.compose.replace"
)
// ComposeVersion is the compose tool version as declared by label VersionLabel