mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Added error when cluster reset while using server flag
Signed-off-by: Vitor Savian <vitor.savian@suse.com>
This commit is contained in:
parent
b010c941cf
commit
b6ab24c4fd
@ -467,6 +467,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
|
||||
|
Loading…
Reference in New Issue
Block a user