Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(NET-591): allow generic DNS entries #2568

Merged
merged 2 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions controllers/dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand All @@ -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")
})

}
Expand Down
2 changes: 1 addition & 1 deletion logic/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand Down
2 changes: 1 addition & 1 deletion mq/publishers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down