From 3bf0c5a31861824e9b8c0a79ed618765317c0a0b Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Fri, 21 Nov 2025 15:29:47 +0100 Subject: [PATCH 1/2] Remove unused --depopulate flag (#3843) --- commands/ppreviewPush.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/commands/ppreviewPush.go b/commands/ppreviewPush.go index 5e29d1a3d..f666dbde3 100644 --- a/commands/ppreviewPush.go +++ b/commands/ppreviewPush.go @@ -12,6 +12,11 @@ import ( "sync/atomic" "time" + "github.com/nozzle/throttler" + "github.com/urfave/cli/v2" + "golang.org/x/exp/slices" + "golang.org/x/net/idna" + "github.com/StackExchange/dnscontrol/v4/models" "github.com/StackExchange/dnscontrol/v4/pkg/bindserial" "github.com/StackExchange/dnscontrol/v4/pkg/credsfile" @@ -22,10 +27,6 @@ import ( "github.com/StackExchange/dnscontrol/v4/pkg/rfc4183" "github.com/StackExchange/dnscontrol/v4/pkg/zonerecs" "github.com/StackExchange/dnscontrol/v4/providers" - "github.com/nozzle/throttler" - "github.com/urfave/cli/v2" - "golang.org/x/exp/slices" - "golang.org/x/net/idna" ) type cmdZoneCache struct { @@ -55,7 +56,6 @@ type PPreviewArgs struct { ConcurMode string ConcurMax int // Maximum number of concurrent connections NoPopulate bool - DePopulate bool PopulateOnPreview bool Report string Full bool @@ -114,11 +114,6 @@ func (args *PPreviewArgs) flags() []cli.Flag { Destination: &args.NoPopulate, Usage: `Do not auto-create zones at the provider`, }) - flags = append(flags, &cli.BoolFlag{ - Name: "depopulate", - Destination: &args.NoPopulate, - Usage: `Delete unknown zones at provider (dangerous!)`, - }) flags = append(flags, &cli.BoolFlag{ Name: "populate-on-preview", Destination: &args.PopulateOnPreview, From 4d29c2c2a5c967aaeb9f547993e79bcced840ddd Mon Sep 17 00:00:00 2001 From: Tom Limoncelli <6293917+tlimoncelli@users.noreply.github.com> Date: Fri, 21 Nov 2025 10:46:18 -0500 Subject: [PATCH 2/2] NEW FEATURE: Empty creds.json should not be an error (#3844) --- pkg/credsfile/providerConfig.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/credsfile/providerConfig.go b/pkg/credsfile/providerConfig.go index c34391947..65a25a7c7 100644 --- a/pkg/credsfile/providerConfig.go +++ b/pkg/credsfile/providerConfig.go @@ -39,6 +39,10 @@ func LoadProviderConfigs(fname string) (map[string]map[string]string, error) { if err != nil { return nil, err } + // Empty file? Add an empty json object. + if len(strings.TrimSpace(string(dat))) == 0 { + dat = []byte(`{}`) + } } s := string(dat) @@ -76,7 +80,7 @@ func isExecutable(filename string) bool { func readCredsFile(filename string) ([]byte, error) { dat, err := utfutil.ReadFile(filename, utfutil.POSIX) if err != nil { - // no creds file is ok. Bind requires nothing for example. Individual providers will error if things not found. + // no creds file is ok. `bind` requires nothing for example. Individual providers will error if things not found. if os.IsNotExist(err) { fmt.Printf("INFO: Config file %q does not exist. Skipping.\n", filename) return []byte{}, nil