Skip to content

fix: correctly handle non-stale restarts #1220

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

Merged
merged 4 commits into from
Apr 18, 2022
Merged

Conversation

piksel
Copy link
Member

@piksel piksel commented Feb 11, 2022

When restarting a container that had dependents, watchtower would previously treat those the same way as stale containers. This means that it would recreate them, even if the necessary information to do so was not present. It also means that it would attempt to clean up the image of the dependent, even though the same image would still be used. This may have been the cause of a number of issues experienced since v1.4.0 was released.

This PR adds checks that makes sure that linked containers also needs a valid config before being stopped, and that their images are only cleaned up if they are actually stale.

@codecov
Copy link

codecov bot commented Feb 11, 2022

Codecov Report

Merging #1220 (b58b6f3) into main (70ca4c2) will decrease coverage by 0.19%.
The diff coverage is 63.63%.

@@            Coverage Diff             @@
##             main    #1220      +/-   ##
==========================================
- Coverage   62.70%   62.50%   -0.20%     
==========================================
  Files          23       23              
  Lines        1488     1507      +19     
==========================================
+ Hits          933      942       +9     
- Misses        471      475       +4     
- Partials       84       90       +6     
Impacted Files Coverage Δ
internal/actions/update.go 63.07% <63.63%> (-6.03%) ⬇️
internal/flags/flags.go 88.82% <0.00%> (+0.17%) ⬆️
pkg/notifications/notifier.go 80.00% <0.00%> (+2.64%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 70ca4c2...b58b6f3. Read the comment docs.

@piksel piksel force-pushed the fix/linked-container-restarts branch from 5d2b020 to cf1ddca Compare February 11, 2022 12:14
@ghost

This comment was marked as off-topic.

@piksel

This comment was marked as off-topic.

@piksel
Copy link
Member Author

piksel commented Apr 18, 2022

There is one added safeguard that would require a lot of mocking, so I am letting it stay uncovered. Chances are that we don't even need the guard, that the problems it's protecting against was caused by the old cleanup-code.

@piksel piksel merged commit e9c83af into main Apr 18, 2022
@piksel piksel deleted the fix/linked-container-restarts branch April 18, 2022 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Watchtower may remove images that are still needed, which causes crashes and failed update attempts
1 participant