Skip to content

Commit

Permalink
Merge pull request #27 from lopatinevgeny/YDBOPS-10454
Browse files Browse the repository at this point in the history
fix YDBOPS-10454
  • Loading branch information
shmel1k authored Sep 27, 2024
2 parents 31331d8 + 79ad923 commit 79ea8a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (o *BaseOptions) DefineFlags(fs *pflag.FlagSet) {
"Override currently set profile name from --config-file")

defaultProfileLocation := ""
if home, present := os.LookupEnv("HOME"); present {
if home, err := os.UserHomeDir(); err == nil {
defaultProfileLocation = filepath.Join(home, "ydb", "ydbops", "config", "config.yaml")
}

Expand Down
5 changes: 4 additions & 1 deletion pkg/profile/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ func FillDefaultsFromActiveProfile(configFile, profileName string) error {
}

for optionName, defValue := range profile.(map[any]any) {
option := pointersToProgramOptions[optionName.(string)]
option, ok := pointersToProgramOptions[optionName.(string)]
if !ok {
return fmt.Errorf("profile `%s` contains unsupported field `%s`", profileName, optionName)
}
if *option.ptr == option.defaultValue {
*option.ptr = defValue.(string)
}
Expand Down

0 comments on commit 79ea8a5

Please sign in to comment.