From e96cce88c14d5c0ca1fba7b5ccc29f1b6192d228 Mon Sep 17 00:00:00 2001 From: Pasha Sviderski Date: Wed, 8 Apr 2026 15:52:14 +1000 Subject: [PATCH] fix(pre-deploy): exclude hook containers from caddy and dns controllers --- internal/machine/caddyconfig/controller.go | 5 ++++- internal/machine/dns/resolver.go | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/machine/caddyconfig/controller.go b/internal/machine/caddyconfig/controller.go index 0640b060..a4afe754 100644 --- a/internal/machine/caddyconfig/controller.go +++ b/internal/machine/caddyconfig/controller.go @@ -94,13 +94,16 @@ func (c *Controller) Run(ctx context.Context) error { } } -// filterHealthyContainers filters out containers that are not healthy. +// filterHealthyContainers filters out unhealthy and hook containers. // TODO: Filters out containers from this machine that are likely unavailable. The availability can be determined // by the cluster membership state of the machine that the container is running on. Implement machine membership // check using Corrossion Admin client. func filterHealthyContainers(containers []store.ContainerRecord) []store.ContainerRecord { healthy := make([]store.ContainerRecord, 0, len(containers)) for _, cr := range containers { + if cr.Container.IsHook() { + continue + } if cr.Container.Healthy() { healthy = append(healthy, cr) } diff --git a/internal/machine/dns/resolver.go b/internal/machine/dns/resolver.go index 56adaaee..f022a0c5 100644 --- a/internal/machine/dns/resolver.go +++ b/internal/machine/dns/resolver.go @@ -72,6 +72,9 @@ func (r *ClusterResolver) updateServiceIPs(containers []store.ContainerRecord) { containersCount := 0 for _, record := range containers { + if record.Container.IsHook() { + continue + } if !record.Container.Healthy() { continue }