Skip to content

Commit

Permalink
fix(nodebuilder/state): overwrite state flags only if they were passe…
Browse files Browse the repository at this point in the history
…d explicitly (celestiaorg#3663)

(cherry picked from commit 0dac760)
  • Loading branch information
vgonkivs authored and walldiss committed Aug 21, 2024
1 parent ea73268 commit f47a083
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nodebuilder/state/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ func Flags() *flag.FlagSet {

// ParseFlags parses State flags from the given cmd and saves them to the passed config.
func ParseFlags(cmd *cobra.Command, cfg *Config) {
cfg.DefaultKeyName = cmd.Flag(keyringKeyNameFlag).Value.String()
cfg.DefaultBackendName = cmd.Flag(keyringBackendFlag).Value.String()
if cmd.Flag(keyringKeyNameFlag).Changed {
cfg.DefaultKeyName = cmd.Flag(keyringKeyNameFlag).Value.String()
}
if cmd.Flag(keyringBackendFlag).Changed {
cfg.DefaultBackendName = cmd.Flag(keyringBackendFlag).Value.String()
}
}

0 comments on commit f47a083

Please sign in to comment.