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 (#3663)
  • Loading branch information
vgonkivs authored Aug 16, 2024
1 parent ff2118d commit 0dac760
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 0dac760

Please sign in to comment.