[#51] Remove current-context flag

Executing "airshipctl config set-context [NAME]" misleadingly prints a
message saying the context has been modified, but doesn't change to that
context or modify any context values. This change modifies the behavior
of context command to switch to a provided context when no flags are
specified. It also removes the current-context flag, which becomes
redundant with this change.

Change-Id: I2622fbf59539513feb1236f13b9090978aeb81ef
Signed-off-by: Drew Walters <andrew.walters@att.com>
This commit is contained in:
Drew Walters
2020-02-18 12:07:10 -06:00
parent f2987e1a8c
commit 18d6e2ac29
7 changed files with 17 additions and 21 deletions

View File

@@ -112,12 +112,9 @@ func TestSetCurrentContext(t *testing.T) {
expconf.CurrentContext = "def_target"
test := setContextTest{
description: "Testing 'airshipctl config set-context' with a new current context",
config: conf,
args: []string{tname},
flags: []string{
"--" + config.FlagCurrentContext + "=true",
},
description: "Testing 'airshipctl config set-context' with a new current context",
config: conf,
args: []string{tname},
expected: `Context "` + tname + `" modified.` + "\n",
expectedConfig: expconf,
}