netbox-docker-plugin icon indicating copy to clipboard operation
netbox-docker-plugin copied to clipboard

:wrench: Enable update trigger on Image Webhook

Open linkdd opened this issue 1 year ago • 4 comments

Decision Record

When the agent fails to pull an image (could be because of a temporary network issue), we have to delete it and recreate it to trigger the webhook again.

Let's enable the webhook for updates as well, so that saving the failed image triggers the webhook, enabling us to retry pulling.

NB: If the size of the image is not 0, the agent will ignore it, so successfully pulled image will still be a "NO-OP".

Changes

  • [x] :recycle: Update webhooks after migrations
  • [x] :wrench: Enable update trigger on Image Webhook

linkdd avatar May 16 '24 15:05 linkdd

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
2292 2254 98% 90%

New Files

No new covered files...

Modified Files

No covered modified files...

updated for commit: 75f93be by action🐍

github-actions[bot] avatar May 16 '24 16:05 github-actions[bot]

@linkdd Many thanks!

Why changing the webhook creation logic (we don't update webhook if it's already exists)?

fanshan avatar May 17 '24 06:05 fanshan

update_or_create was easier and clearer than:

  • filter
  • if found create
  • else filter+update

linkdd avatar May 17 '24 08:05 linkdd

Is not easer or cleaner, you change the logic. We don’t update the webhook if it exists.

Le 17 mai 2024 à 10:50, David Delassus @.***> a écrit :

update_or_create was easier and clearer than:

filter if found create else filter+update — Reply to this email directly, view it on GitHub https://github.com/SaaShup/netbox-docker-plugin/pull/129#issuecomment-2117065317, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPE3XYHXHU2IQAELZYDE7LZCXAGLAVCNFSM6AAAAABH2P7LLWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJXGA3DKMZRG4. You are receiving this because your review was requested.

fanshan avatar May 17 '24 08:05 fanshan