Can you please add this to the post-update
The (still undocumented) feature is great for our purpose, but can you add the same functionality to the post-update hook (in the same manner, of course)?
I have added a script to the post-update to check the database-version. If they not match, the script returns exit 1. It would be great if the post-update hook could log a error- or warning-message, so the slack-notification gets a message (level warn) and we are alarmed that something went wrong.
https://github.com/containrrr/watchtower/blob/9e7dfe7be442d1259b6ed5223558f2201f1fd43b/internal/actions/update.go#L76-L80
The original issue: https://github.com/containrrr/watchtower/issues/499
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! 🙏
So basically changing this to log an error if the error code is not 0?: https://github.com/containrrr/watchtower/blob/9e7dfe7be442d1259b6ed5223558f2201f1fd43b/internal/actions/update.go#L124
Yes, this is correct. Seems not to be a big deal.
I agree that this change makes sense.
Hello! Sure, @11-aryan. I'd be happy to review it!
Hi @piksel I have created on PR to solve this issue please let me know if you have any suggestions for this change #1791
Actually, I think this is already implemented? Looking at the code:
https://github.com/containrrr/watchtower/blob/284066a39d083fe4865ae43119a41b42d450b178/pkg/lifecycle/lifecycle.go#L101-L105
It already adds an error log message (which will be sent in notifications) if the post update hook returns something other than a 0.
Hi @piksel Thanks for the update Can you please give me more context on this? or Do we need to add a testcase for this?
As this has already been fixed, I'm closing this issue.