mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-12-03 10:33:40 +01:00
Let Home Assistant decide Supervisor updates for its own channel. Preserve monitoring, suppress the non-comparison in old and new agent reports, and retire stale alias-only alerts without clearing unknown checks for other containers. Contract-Neutral: Corrects which Docker image observation is comparable without changing report or resource schemas, alert lifecycles for checkable images, settings, or action authority. Change-source: pulse-maintainer
22 lines
839 B
Go
22 lines
839 B
Go
package dockeragent
|
|
|
|
import "strings"
|
|
|
|
// UsesHomeAssistantSupervisorAlias identifies the Supervisor's local "latest"
|
|
// alias. Home Assistant chooses the installed release through its own update
|
|
// channel; GHCR's "latest" digest does not say whether that channel has an
|
|
// update. An explicit version or digest, or a Compose deployment, is not
|
|
// this alias. Keep this predicate shared by collection, ingest and alerting.
|
|
func UsesHomeAssistantSupervisorAlias(name, image string, labels map[string]string) bool {
|
|
if strings.TrimPrefix(name, "/") != "hassio_supervisor" || labels["com.docker.compose.project"] != "" {
|
|
return false
|
|
}
|
|
switch strings.TrimSuffix(image, ":latest") {
|
|
case "ghcr.io/home-assistant/amd64-hassio-supervisor",
|
|
"ghcr.io/home-assistant/aarch64-hassio-supervisor":
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|