-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
detect replacement container is created and inform printer so it attach and don't stop [ENV-87] #10236
Conversation
bc46f17
to
0bb0f21
Compare
Codecov ReportBase: 73.89% // Head: 73.89% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## v2 #10236 +/- ##
=======================================
Coverage 73.89% 73.89%
=======================================
Files 2 2
Lines 272 272
=======================================
Hits 201 201
Misses 60 60
Partials 11 11 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
0bb0f21
to
922f635
Compare
…ch and don't stop Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
922f635
to
c71b256
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! This is nifty
@@ -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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah this is clever and I like that it lets us reliably associate it with the old one by ID!
change a bit the "recreate" logic:
this allows to set a "replace" label on replacement container, and to detect the replaced container should not trigger printer to stop printing logs on exit.
how to test:
docker compose up
docker compose up --force-recreate -d
same applies to
docker compose logs -f