Fix the import warning for allow-update { none; }; document CLI config paths

jarld import warned that zones with allow-update { none; } use dynamic
updates, though that turns them off (validation already allowed it).
docs/cli.md now gives the CLI configuration file's location on macOS and
Windows, not only ~/.config/jarl/config.yaml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
abrown38andClaude Opus 5.5 committed 2026-10-09 09:05:59 +00:00
1 parent a3a1da54df
commit b22ffee1bb
5 files changed
+59 -4

No files matched your search

+19
View File
@@ -146,3 +146,22 @@ func TestParseTTL(t *testing.T) {
}
}
}
func TestImportAllowUpdateWarning(t *testing.T) {
dir := t.TempDir()
os.WriteFile(filepath.Join(dir, "x.db"), []byte("$TTL 300\n@ IN SOA ns1.x.test. h.x.test. 1 2 3 4 5\n@ IN NS ns1\nns1 IN A 192.0.2.1\n"), 0o644)
for conf, want := range map[string]bool{
`allow-update { none; };`: false,
`allow-update { 127.0.0.1; };`: true,
`update-policy local;`: true,
} {
os.WriteFile(filepath.Join(dir, "named.conf"), []byte(`zone "x.test" { type primary; file "`+dir+`/x.db"; `+conf+` };`), 0o644)
_, rep, err := Import(context.Background(), filepath.Join(dir, "named.conf"), Options{Alloc: seqAlloc()})
if err != nil {
t.Fatal(err)
}
if got := len(rep.Warnings) > 0; got != want {
t.Errorf("%s: warnings = %v", conf, rep.Warnings)
}
}
}