deprecation msgs for KUBECTX_CURRENT_{BG,FG}COLOR

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
Ahmet Alp Balkan
2020-04-29 12:11:59 -07:00
parent 5b745727c3
commit 4bbe0fad79
7 changed files with 72 additions and 11 deletions

View File

@@ -0,0 +1,22 @@
package cmdutil
import (
"io"
"strings"
"github.com/ahmetb/kubectx/internal/printer"
)
func PrintDeprecatedEnvWarnings(out io.Writer, vars []string) {
for _, vv := range vars {
parts := strings.SplitN(vv, "=", 2)
if len(parts) != 2 {
continue
}
key := parts[0]
if key == `KUBECTX_CURRENT_FGCOLOR` || key == `KUBECTX_CURRENT_BGCOLOR` {
printer.Warning(out,"%s environment variable is now deprecated", key)
}
}
}