kubectx/internal/cmdutil/deprecated.go
Ahmet Alp Balkan 84676b7062
deprecation msgs for KUBECTX_CURRENT_{BG,FG}COLOR
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2020-04-29 12:11:59 -07:00

23 lines
439 B
Go

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)
}
}
}