ensure network add to new extclient for dns update

This commit is contained in:
Matthew R Kasun 2023-02-08 14:02:01 -05:00
parent 574583b3b1
commit e0478b9b54

View file

@ -316,8 +316,8 @@ func PublishExtCLientDNS(client *models.ExtClient) error {
func PublishExtClientDNSUpdate(old, new models.ExtClient, network string) error {
dns := models.DNSUpdate{
Action: models.DNSReplaceName,
Name: old.ClientID + "." + old.Network,
NewName: new.ClientID + "." + new.Network,
Name: old.ClientID + "." + network,
NewName: new.ClientID + "." + network,
}
if err := PublishDNSUpdate(network, dns); err != nil {
return err
@ -329,7 +329,7 @@ func PublishExtClientDNSUpdate(old, new models.ExtClient, network string) error
func PublishDeleteExtClientDNS(client *models.ExtClient) error {
dns := models.DNSUpdate{
Action: models.DNSDeleteByName,
Name: client.ClientID,
Name: client.ClientID + "." + client.Network,
}
if err := PublishDNSUpdate(client.Network, dns); err != nil {
return err