From 9571705fc36398c346c80c98dc595deb956ebe95 Mon Sep 17 00:00:00 2001 From: Rogger Vasquez Date: Tue, 12 Jul 2022 16:19:37 -0500 Subject: [PATCH] rpk: bootstrap and init to use file or default we want that every write path of rpk use only what is in the file or the default if there is no file on disk. --- src/go/rpk/pkg/cli/cmd/redpanda/config.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/go/rpk/pkg/cli/cmd/redpanda/config.go b/src/go/rpk/pkg/cli/cmd/redpanda/config.go index 16081479defa5..1757d41e2efde 100644 --- a/src/go/rpk/pkg/cli/cmd/redpanda/config.go +++ b/src/go/rpk/pkg/cli/cmd/redpanda/config.go @@ -105,6 +105,7 @@ func bootstrap(fs afero.Fs) *cobra.Command { p := config.ParamsFromCommand(cmd) cfg, err := p.Load(fs) out.MaybeDie(err, "unable to load config: %v", err) + cfg = cfg.FileOrDefaults() // we modify fields in the raw file without writing env / flag overrides seeds, err := parseSeedIPs(ips) out.MaybeDieErr(err) @@ -168,6 +169,7 @@ func initNode(fs afero.Fs) *cobra.Command { p := config.ParamsFromCommand(cmd) cfg, err := p.Load(fs) out.MaybeDie(err, "unable to load config: %v", err) + cfg = cfg.FileOrDefaults() // we modify fields in the raw file without writing env / flag overrides // Don't reset the node's UUID if it has already been set. if cfg.NodeUUID == "" {