Skip to content

Commit 03ac864

Browse files
authored
fix(cli): avoid panic in configure command when no local config exists (#23085) (#23967)
Signed-off-by: Kevin Park <[email protected]>
1 parent 27b70cf commit 03ac864

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmd/argocd/commands/configure.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package commands
22

33
import (
44
"fmt"
5+
"os"
56
"strconv"
67

78
"github.com/spf13/cobra"
@@ -27,6 +28,10 @@ argocd configure --prompts-enabled=false`,
2728
Run: func(_ *cobra.Command, _ []string) {
2829
localCfg, err := localconfig.ReadLocalConfig(globalClientOpts.ConfigPath)
2930
errors.CheckError(err)
31+
if localCfg == nil {
32+
fmt.Println("No local configuration found")
33+
os.Exit(1)
34+
}
3035

3136
localCfg.PromptsEnabled = promptsEnabled
3237

0 commit comments

Comments
 (0)