Skip to content

Commit

Permalink
rpk: bootstrap and init to use file or default
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
r-vasquez committed Jul 12, 2022
1 parent 3201e51 commit bc5635c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/go/rpk/pkg/cli/cmd/redpanda/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

seeds, err := parseSeedIPs(ips)
out.MaybeDieErr(err)
Expand Down Expand Up @@ -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()

// Don't reset the node's UUID if it has already been set.
if cfg.NodeUUID == "" {
Expand Down

0 comments on commit bc5635c

Please sign in to comment.