fix(containers): fall back to image tag when version metadata is empty

This commit is contained in:
2026-08-03 14:22:52 +01:00
parent bbc5db473a
commit 3f9fe07c7b
2 changed files with 10 additions and 0 deletions
+4
View File
@@ -47,6 +47,10 @@ func InstallContainer(ctx context.Context, item types.RegistryContainer) error {
} }
// 2.5. Persist install metadata so installed-but-not-running state can be tracked without Docker lookups // 2.5. Persist install metadata so installed-but-not-running state can be tracked without Docker lookups
// The version is required for update detection; fall back to the image tag when the payload omitted it.
if item.Version == "" {
item.Version = imageTag(item.Image)
}
metadata := types.InstalledMetadata{ metadata := types.InstalledMetadata{
RegistryContainer: item, RegistryContainer: item,
InstalledAt: time.Now().UTC().Format(time.RFC3339), InstalledAt: time.Now().UTC().Format(time.RFC3339),
+6
View File
@@ -37,6 +37,12 @@ func (cache *ContainerCache) LoadInstalledContainers() error {
continue continue
} }
// Older install records left the version empty; fall back to the image tag
// so update detection has something to compare against.
if metadata.Version == "" {
metadata.Version = imageTag(metadata.Image)
}
cache.AddService(types.Container{ cache.AddService(types.Container{
ServiceName: name, ServiceName: name,
Name: metadata.Name, Name: metadata.Name,