mirror of
https://github.com/rancher/os.git
synced 2025-07-05 11:06:13 +00:00
Merge pull request #1019 from joshwget/console-switch-warning
Warn when attempting to switch to the same console
This commit is contained in:
commit
21fce533b8
@ -48,6 +48,11 @@ func consoleSwitch(c *cli.Context) error {
|
||||
}
|
||||
newConsole := c.Args()[0]
|
||||
|
||||
cfg := config.LoadConfig()
|
||||
if newConsole == cfg.Rancher.Console {
|
||||
log.Warnf("Console is already set to %s", newConsole)
|
||||
}
|
||||
|
||||
if !c.Bool("force") {
|
||||
in := bufio.NewReader(os.Stdin)
|
||||
fmt.Println("Switching consoles will destroy the current console container and restart Docker.")
|
||||
@ -57,8 +62,6 @@ func consoleSwitch(c *cli.Context) error {
|
||||
}
|
||||
}
|
||||
|
||||
cfg := config.LoadConfig()
|
||||
|
||||
if newConsole != "default" {
|
||||
if err := compose.StageServices(cfg, newConsole); err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user