mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-09-11 13:28:59 +00:00
deprecation msgs for KUBECTX_CURRENT_{BG,FG}COLOR
Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
22
internal/cmdutil/deprecated.go
Normal file
22
internal/cmdutil/deprecated.go
Normal 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)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user