From efe4ed8c1b16afe080c42424c33fb5814ddde014 Mon Sep 17 00:00:00 2001 From: Hakan Sariman Date: Thu, 18 Sep 2025 15:05:41 +0700 Subject: [PATCH] Refactor DNS server update to use structured hash type for configuration --- client/internal/dns/server.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/internal/dns/server.go b/client/internal/dns/server.go index 8cb886203..93541d4c7 100644 --- a/client/internal/dns/server.go +++ b/client/internal/dns/server.go @@ -391,7 +391,15 @@ func (s *DefaultServer) UpdateDNSServer(serial uint64, update nbdns.Config) erro s.mux.Lock() defer s.mux.Unlock() - hash, err := hashstructure.Hash(update, hashstructure.FormatV2, &hashstructure.HashOptions{ + hashType := struct { + ServiceEnable bool + NameServerGroups []*nbdns.NameServerGroup + }{ + ServiceEnable: update.ServiceEnable, + NameServerGroups: update.NameServerGroups, + } + + hash, err := hashstructure.Hash(hashType, hashstructure.FormatV2, &hashstructure.HashOptions{ ZeroNil: true, IgnoreZeroValue: true, SlicesAsSets: true,