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 14, 2022
1 parent 35eac78 commit df4697e
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() // we modify fields in the raw file without writing env / flag overrides

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() // 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 == "" {
Expand Down

0 comments on commit df4697e

Please sign in to comment.