mirror of
https://github.com/gravitl/netmaker.git
synced 2024-09-20 07:16:06 +08:00
feat(NET-591): allow generic DNS entries (#2568)
This commit is contained in:
parent
7c4870e82f
commit
fe842e0f05
|
@ -238,7 +238,7 @@ func TestSetDNS(t *testing.T) {
|
|||
assert.False(t, info.IsDir())
|
||||
content, err := os.ReadFile("./config/dnsconfig/netmaker.hosts")
|
||||
assert.Nil(t, err)
|
||||
assert.Contains(t, string(content), "linuxhost.skynet")
|
||||
assert.Contains(t, string(content), "linuxhost")
|
||||
})
|
||||
t.Run("EntryExists", func(t *testing.T) {
|
||||
entry := models.DNSEntry{Address: "10.0.0.3", Name: "newhost", Network: "skynet"}
|
||||
|
@ -251,7 +251,7 @@ func TestSetDNS(t *testing.T) {
|
|||
assert.False(t, info.IsDir())
|
||||
content, err := os.ReadFile("./config/dnsconfig/netmaker.hosts")
|
||||
assert.Nil(t, err)
|
||||
assert.Contains(t, string(content), "newhost.skynet")
|
||||
assert.Contains(t, string(content), "newhost")
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ func SetDNS() error {
|
|||
return err
|
||||
}
|
||||
for _, entry := range dns {
|
||||
hostfile.AddHost(entry.Address, entry.Name+"."+entry.Network)
|
||||
hostfile.AddHost(entry.Address, entry.Name)
|
||||
}
|
||||
}
|
||||
if corefilestring == "" {
|
||||
|
|
|
@ -315,7 +315,7 @@ func PublishDeleteExtClientDNS(client *models.ExtClient) error {
|
|||
func PublishCustomDNS(entry *models.DNSEntry) error {
|
||||
dns := models.DNSUpdate{
|
||||
Action: models.DNSInsert,
|
||||
Name: entry.Name + "." + entry.Network,
|
||||
Name: entry.Name,
|
||||
//entry.Address6 is never used
|
||||
Address: entry.Address,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue