Skip to content

Commit

Permalink
fix: upgrade config not applying (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdand-weka authored Mar 1, 2024
1 parent 2319002 commit 3944055
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions internal/cli/local/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,16 @@ var upgradeCmd = &cobra.Command{
jsonConfig = upgradeConfig.JsonConfig
}

if upgradeConfig.JsonConfig != "" {
// Use cli configuration over config json passed for overwrite
var cfg config_v1.Configuration

err := errors.Join(
config.ReadV1(jsonConfig, &cfg), // read config into cfg
mergo.Merge(&upgradeConfig.Configuration, cfg), // merge cfg into upgradeConfig
)
if err != nil {
return err
}
// Use cli configuration over config json passed for overwrite
var cfg config_v1.Configuration

err = errors.Join(
config.ReadV1(jsonConfig, &cfg), // read config into cfg
mergo.Merge(&upgradeConfig.Configuration, cfg), // merge cfg into upgradeConfig
)

if err != nil {
return err
}

if err := readTLS(upgradeConfig.TLSCert, upgradeConfig.TLSKey, &upgradeConfig.Configuration); err != nil {
Expand Down

0 comments on commit 3944055

Please sign in to comment.