mirror of https://github.com/k3s-io/k3s
Added error when cluster reset while using server flag
Signed-off-by: Vitor Savian <vitor.savian@suse.com>pull/8511/head
parent
d8402c1578
commit
940bbd19bb
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue