From 3ba449335c52c3a051cb7592cea506c3ea6c8397 Mon Sep 17 00:00:00 2001 From: Viktor Liu Date: Thu, 1 Aug 2024 11:48:50 +0200 Subject: [PATCH] Allow route updates even if some domains failed resolution --- client/internal/routemanager/dynamic/route.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/client/internal/routemanager/dynamic/route.go b/client/internal/routemanager/dynamic/route.go index 8429b4534de..e957107980b 100644 --- a/client/internal/routemanager/dynamic/route.go +++ b/client/internal/routemanager/dynamic/route.go @@ -189,9 +189,14 @@ func (r *Route) startResolver(ctx context.Context) { } func (r *Route) update(ctx context.Context) error { - if resolved, err := r.resolveDomains(); err != nil { - return fmt.Errorf("resolve domains: %w", err) - } else if err := r.updateDynamicRoutes(ctx, resolved); err != nil { + resolved, err := r.resolveDomains() + if err != nil { + if len(resolved) == 0 { + return fmt.Errorf("resolve domains: %w", err) + } + log.Warnf("Failed to resolve domains: %v", err) + } + if err := r.updateDynamicRoutes(ctx, resolved); err != nil { return fmt.Errorf("update dynamic routes: %w", err) }