Two drift-reporting bugs: 1. The monitor listed only the podman runtime, so unikernel VMs always showed observed=unknown (false drift). It now takes a ContainerLister and the agent passes a merged lister (containers + VMs), mirroring listAllContainers. 2. The monitor computed the lookup name as service+"-"+component, which is wrong when component==service (the name collapses to just the service, e.g. "uktest"/"mc-proxy"). It now uses the canonical naming.ContainerNameFor — extracted to a shared package so the agent and monitor can't disagree. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
15 lines
536 B
Go
15 lines
536 B
Go
package agent
|
|
|
|
import "git.wntrmute.dev/mc/mcp/internal/naming"
|
|
|
|
// ContainerNameFor is a convenience alias for naming.ContainerNameFor (the
|
|
// canonical convention, shared with the monitor).
|
|
func ContainerNameFor(service, component string) string {
|
|
return naming.ContainerNameFor(service, component)
|
|
}
|
|
|
|
// SplitContainerName is a convenience alias for naming.SplitContainerName.
|
|
func SplitContainerName(name string, knownServices map[string]bool) (service, component string) {
|
|
return naming.SplitContainerName(name, knownServices)
|
|
}
|