Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Name both digests when a container update preflight refuses

rcourtman022316fca6d9
diff --git a/internal/dockeragent/container_update_typed.go b/internal/dockeragent/container_update_typed.go
index 0f83688089..26dfc8d122 100644
--- a/internal/dockeragent/container_update_typed.go
+++ b/internal/dockeragent/container_update_typed.go
@@ -34,16 +34,21 @@ func (a *Agent) TypedContainerUpdate(ctx context.Context, runtime, containerID,
localImageID := strings.TrimSpace(inspect.Image)
matchesLocalID := strings.EqualFold(localImageID, expectedImageDigest)
matchesRepoDigest := false
+ repoDigest := ""
if !matchesLocalID {
imageName := ""
if inspect.Config != nil {
imageName = inspect.Config.Image
}
- repoDigest, _, _, _ := a.getImageRepoDigest(ctx, localImageID, imageName)
- matchesRepoDigest = strings.EqualFold(strings.TrimSpace(repoDigest), expectedImageDigest)
+ repoDigest, _, _, _ = a.getImageRepoDigest(ctx, localImageID, imageName)
+ repoDigest = strings.TrimSpace(repoDigest)
+ matchesRepoDigest = strings.EqualFold(repoDigest, expectedImageDigest)
}
if !matchesLocalID && !matchesRepoDigest {
- return agentexec.DockerContainerUpdateOutcome{}, fmt.Errorf("container image digest no longer matches the planned update")
+ if repoDigest == "" {
+ repoDigest = "unavailable"
+ }
+ return agentexec.DockerContainerUpdateOutcome{}, fmt.Errorf("container image digest no longer matches the planned update (expected %s, local image id %s, local repo digest %s)", expectedImageDigest, localImageID, repoDigest)
}
}