mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-03 18:35:01 +08:00
publish dns update on custom dns deletion
This commit is contained in:
parent
4f7c038702
commit
dbad8ac463
2 changed files with 9 additions and 0 deletions
|
@ -224,6 +224,14 @@ func deleteDNS(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
json.NewEncoder(w).Encode(entrytext + " deleted.")
|
json.NewEncoder(w).Encode(entrytext + " deleted.")
|
||||||
|
dns := models.DNSUpdate{
|
||||||
|
Action: models.DNSDeleteByName,
|
||||||
|
Name: entrytext,
|
||||||
|
}
|
||||||
|
if err := mq.PublishDNSUpdate(params["network"], dns); err != nil {
|
||||||
|
logger.Log(0, "failed to publish dns update", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetDNSEntry - gets a DNS entry
|
// GetDNSEntry - gets a DNS entry
|
||||||
|
|
|
@ -326,6 +326,7 @@ func PublishCustomDNS(entry *models.DNSEntry) error {
|
||||||
if err := PublishDNSUpdate(entry.Network, dns); err != nil {
|
if err := PublishDNSUpdate(entry.Network, dns); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// function to collect and store metrics for server nodes
|
// function to collect and store metrics for server nodes
|
||||||
|
|
Loading…
Add table
Reference in a new issue