From a9e34206bc876bb605b60443a2181bbeaec79224 Mon Sep 17 00:00:00 2001 From: Josh Curl Date: Thu, 16 Jun 2016 09:52:02 -0700 Subject: [PATCH] Warn when attempting to switch to the same console --- cmd/control/console.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/control/console.go b/cmd/control/console.go index 9bd25a51..0afae98b 100644 --- a/cmd/control/console.go +++ b/cmd/control/console.go @@ -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