Skip to content

Commit 6b5952d

Browse files
committed
Fix
1 parent d6afa27 commit 6b5952d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

internal/namespaces/object/v1/custom_config_install.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,18 @@ func configInstallCommand() *core.Command {
8383

8484
// Ask whether to remove previous configuration file if it exists
8585
if _, err := os.Stat(configPath); err == nil {
86-
_, err := interactive.PromptBoolWithConfig(&interactive.PromptBoolConfig{
86+
doIt, err := interactive.PromptBoolWithConfig(&interactive.PromptBoolConfig{
8787
Prompt: "Do you want to overwrite the existing configuration file (" + configPath + ")?",
8888
DefaultValue: false,
8989
})
9090
if err != nil {
9191
return nil, err
9292
}
93+
if !doIt {
94+
return "Installation aborted by user", nil
95+
}
9396
}
94-
err = ioutil.WriteFile(configPath, []byte(newConfig), 0644)
97+
err = ioutil.WriteFile(configPath, []byte(newConfig), 0600)
9598
if err != nil {
9699
return "", err
97100
}

0 commit comments

Comments
 (0)