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 <vitor.savian@suse.com>
  • Loading branch information
vitorsavian committed Sep 27, 2023
1 parent d8402c1 commit 940bbd1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/cli/server/server.go
Expand Up @@ -474,6 +474,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 940bbd1

Please sign in to comment.