state: a state file without a section loads it empty (closes #267)
check / check (push) Canceled after 0s

Load fills in each of domains, hostnames, ports and certificates that
the file leaves out or holds as null with an empty map. Before, such a
section loaded as a nil map, and the first check's write into it
panicked, so a state file holding {} stopped the watcher at every
start.

A state test loads {} and a file missing each section in turn, and
checks that every section is an empty map. A watcher test loads {}, and
a file without the certificates section, runs the first check against
live DNS, and checks that it saved domain, hostname, port and
certificate entries.

Model: opus-5-5
This commit was merged in pull request #278.
This commit is contained in:
2026-10-13 20:27:27 +02:00
parent 3592302615
commit 9e6871817a
5 changed files with 124 additions and 0 deletions
+4
View File
@@ -662,6 +662,10 @@ A port entry's `hostnames` lists every name that resolves to its address,
domains included. A port entry in the older format, with one `hostname` instead
of the `hostnames` list, loads as a list of that one name.
A state file that leaves out any of `domains`, `hostnames`, `ports` and
`certificates`, or holds `null` for one, loads with that section empty. A file
holding `{}` loads as empty state.
---
## Entrypoints