Skip to content

Commit

Permalink
Added error when cluster reset while using server flag
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Savian <[email protected]>
  • Loading branch information
vitorsavian committed Sep 25, 2023
1 parent 550dd05 commit 4c409c9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/cli/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,12 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
cfg.DisableAgent = true
}

// If the user uses the cluster-reset argument in a cluster that has a ServerURL, we must return an error
// to remove the server flag on the configuration or in the cli
if serverConfig.ControlConfig.JoinURL != "" {
return errors.New("cannot perform cluster-reset while server URL is set - remove server from configuration before resetting")
}

dataDir, err := datadir.LocalHome(cfg.DataDir, false)
if err != nil {
return err
Expand Down

0 comments on commit 4c409c9

Please sign in to comment.