publish dns update on custom dns deletion

This commit is contained in:
Matthew R Kasun 2023-02-06 11:27:50 -05:00
parent 4f7c038702
commit dbad8ac463
2 changed files with 9 additions and 0 deletions

View file

@ -224,6 +224,14 @@ func deleteDNS(w http.ResponseWriter, r *http.Request) {
return
}
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

View file

@ -326,6 +326,7 @@ func PublishCustomDNS(entry *models.DNSEntry) error {
if err := PublishDNSUpdate(entry.Network, dns); err != nil {
return err
}
return nil
}
// function to collect and store metrics for server nodes