From d1e884f2e2debee8a37d4224b7c964b535c53412 Mon Sep 17 00:00:00 2001 From: Virgil Date: Sat, 4 Apr 2026 02:52:17 +0000 Subject: [PATCH] fix(action): make dns.discover side-effect only Co-Authored-By: Virgil --- action.go | 4 ++-- service_test.go | 11 ++--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/action.go b/action.go index 2e30598..f1542e0 100644 --- a/action.go +++ b/action.go @@ -147,13 +147,13 @@ func (service *Service) ActionDefinitions() []ActionDefinition { if err := service.DiscoverAliases(context.Background()); err != nil { return nil, false, err } - return service.Health(), true, nil + return nil, true, nil }, InvokeContext: func(ctx context.Context, _ map[string]any) (any, bool, error) { if err := service.DiscoverAliases(ctx); err != nil { return nil, false, err } - return service.Health(), true, nil + return nil, true, nil }, }, } diff --git a/service_test.go b/service_test.go index d558309..21d4a6d 100644 --- a/service_test.go +++ b/service_test.go @@ -3499,18 +3499,11 @@ func TestServiceHandleActionReverseHealthServeAndDiscover(t *testing.T) { if err != nil { t.Fatalf("unexpected discover action error: %v", err) } - if discoverPayload == nil || !ok { - t.Fatal("expected discover action payload") - } if !ok { t.Fatal("expected discover action to succeed") } - discoverHealth, ok := discoverPayload.(HealthResult) - if !ok { - t.Fatalf("expected discover action payload HealthResult, got %T", discoverPayload) - } - if discoverHealth.TreeRoot != "discover-root" { - t.Fatalf("expected discover to refresh tree root, got %#v", discoverHealth.TreeRoot) + if discoverPayload != nil { + t.Fatalf("expected discover action to be side-effect only, got %#v", discoverPayload) } }