-
Notifications
You must be signed in to change notification settings - Fork 854
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
Update containers only if there has not been an update in last X days #1847
Comments
Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏 |
Probably to implement this, it'll need to maintain certain containers info, i.e. last time updated by watchtower. That way it can compare. |
In the manifest (image meta data) there is a It might be a bit too complex to include in the watchtower core though... Not sure. |
OK, but the created field might not be totally accurate, depending on how we want to define this. Because a container recreation outside the watchtower flow would update it. It was thinking originally that watchtower to consider only the dates it creates a new container by itself. That is why I thought a kind of internal state should be kept. |
I meant the image's I see now that you wrote
But that could still lead to an "untested" image being used. I don't see how waiting X days from when your local container was updated would help solving the problem? |
OK, now I see, you mean that creation field, that is fine. Let's explain how this would work: Every day at update time, watchtower will grab the hash of any new image, with that date as timestamp, forcing to maintain a file with the first observation of this hash for futher checks to come, or better, use those images creation field you mentioned (can that be query remotely? probably not, so image can be download it then for this) without any need to keep a separate file. In any case, we compare the hash it against the current one in usage, to start with. A bit overworded, but to make it clearer. (hoefully) |
Hello Same request for me. I don't use watchtower because it would require a delay for updates and avoid too rapid updates Good idea, good request :-D |
I came here looking for the same option to enable for at least some of my containers, probably all of them. I don't need to be on the bleeding edge the day it is released, but do love the automation that watchtower provides to keep containers up to date eventually. The reason I came looking for this today was, as @fede843 noted, I had a package update a few times now where there were some issues that were only caught after several people installed it, after which a new version was published to fix the issue. I would prefer to wait to install until there is stability on the latest, which as @fede843 described would be after the latest has been around for a few days. I don't think it's necessary to add very much complex logic here to do this though. It could simply do what it's doing today, i.e. check daily for the latest release, then if this delayed install flag is set, see if that latest release's Created tag is >= the # of days to delay, and if so, perform the update, otherwise wait. Given that this project is open source I'm happy to look into what it might take to implement if that helps. |
I've made changes to support this. Working on validating it now and will push a PR once it looks to be working. Hopefully folks here are OK w/ the changes I made but was pretty straightforward -- will share the PR detail here in case anyone here has any input also. |
Came here for this feature. For a particular image, I want to eventually update after a week of no updates, rather than immediately. @pjdubya did you file a PR? |
Is your feature request related to a problem? Please describe.
Hello,
I was reading the documentation I and was hopping to find some feature to let me update the container's image only if it has been updated, and no update has happened in the last X days.
This is to prevent some rushed updates. Some projects are released without a proper testing maybe (or perhaps with the proper testing but still failing under certain conditions), and quickly after release, community gives feedback and they publish a quick minor update with the fix.
That would allow to be on the latest version, with some more "safety" feeling if you will.
Describe the solution you'd like
Have a label, say wait_N_days_before_update (or the name you like) where user can set the proper time when needed.
Describe alternatives you've considered
For some containers I had troubles in the past, I have disabled watchtower. From Portainer GUI is easy to detect if an update is available. Then I go check if it is recent or not, and depending on that I make the decision of updating or not.
Additional context
No response
The text was updated successfully, but these errors were encountered: