config: fail fast when DNSWATCHER_TARGETS is empty #77
Reference in New Issue
Block a user
Delete Branch "fix/empty-targets-validation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When
DNSWATCHER_TARGETSis empty or unset (the default), dnswatcher now exits with a clear error message instead of silently starting with nothing to monitor.Changes
ErrNoTargetssentinel error ininternal/config/config.gobuildConfignow validates that at least one domain or hostname is configured after target classificationconfig.NewreturnsErrNoTargets, causing the fx application to fail to start with a clear error messageclassifyAndValidateTargets()andparseDurationOrDefault()helpers to keepbuildConfigwithin the funlen limitTestNewReturnsErrNoTargetsWhenEmptyandTestNewSucceedsWithTargetsCloses #69
Closing as duplicate — PR #75 already addresses issue #69 and is merge-ready.
Pull request closed