From cf6ad4726b78f69145263424e97a8290ef5dfeb6 Mon Sep 17 00:00:00 2001 From: Vishal Dalwadi <51291657+VishalDalwadi@users.noreply.github.com> Date: Fri, 21 Nov 2025 13:47:51 +0530 Subject: [PATCH] Merge pull request #3739 from gravitl/fix/dns Unique DNS Subscriptions --- mq/publishers.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mq/publishers.go b/mq/publishers.go index 0c336a39..1059480f 100644 --- a/mq/publishers.go +++ b/mq/publishers.go @@ -292,7 +292,7 @@ func PushSyncDNS(dnsEntries []models.DNSEntry) error { if mqclient == nil || !mqclient.IsConnectionOpen() { return errors.New("cannot publish ... mqclient not connected") } - if token := mqclient.Publish(fmt.Sprintf("host/dns/sync/%s", dnsEntries[0].Network), 0, true, data); !token.WaitTimeout(MQ_TIMEOUT*time.Second) || token.Error() != nil { + if token := mqclient.Publish(fmt.Sprintf("host/dns/sync/%s/%s", dnsEntries[0].Network, servercfg.GetServer()), 0, true, data); !token.WaitTimeout(MQ_TIMEOUT*time.Second) || token.Error() != nil { var err error if token.Error() == nil { err = errors.New("connection timeout") @@ -301,5 +301,17 @@ func PushSyncDNS(dnsEntries []models.DNSEntry) error { } return err } + if !servercfg.DeployedByOperator() { + if token := mqclient.Publish(fmt.Sprintf("host/dns/sync/%s", dnsEntries[0].Network), 0, true, data); !token.WaitTimeout(MQ_TIMEOUT*time.Second) || token.Error() != nil { + var err error + if token.Error() == nil { + err = errors.New("connection timeout") + } else { + err = token.Error() + } + return err + } + } + return nil }