fix(watcher): backfill image.source onto existing container rows#119
Merged
Conversation
The OCI source label was read from the image inspect, which runs after the early-return for already-known running containers, so the field only ever populated on a container's first detection. Existing store rows never gained it, leaving auto-detected release-notes links blank until a container was recreated. Read the label from the list response's merged labels instead (available before the early-return, and how the watcher already reads its other labels) and backfill it onto cached rows that lack it. A single watch cycle now populates image.source across the fleet with no manual re-detection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The auto-detected release-notes link (1.4.1) only appeared for containers detected after the upgrade.
image.sourcewas read from the image inspect, which runs after the watcher's early-return for already-known running containers, so existing store rows never gained the field. On a running fleet, none of the pre-existing containers showed the link until they were recreated.Fix
org.opencontainers.image.sourcefrom the list response's merged labels (available before the early-return, and how the watcher already reads its other labels).updateContainer.A single watch cycle now populates
image.sourceacross all existing containers with no manual re-detection.Verified
image.sourceonto 47 previously-stored containers that were never manually re-added. No-link-template containers (e.g. searxng) now carry the source and render the "Link (auto-detected)" row.