aboutsummaryrefslogtreecommitdiff
path: root/internal/prompt
diff options
context:
space:
mode:
Diffstat (limited to 'internal/prompt')
-rw-r--r--internal/prompt/cloud.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/internal/prompt/cloud.go b/internal/prompt/cloud.go
index 807d2e2..42a2c39 100644
--- a/internal/prompt/cloud.go
+++ b/internal/prompt/cloud.go
@@ -1,6 +1,6 @@
/*******************************************************************************
*
-* Copyright 2017-2020 Stefan Majewsky <majewsky@gmx.net>
+* Copyright 2017 Stefan Majewsky <majewsky@gmx.net>
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
@@ -55,11 +55,8 @@ func getKubernetesField() string {
}
namespace = ""
}
- if namespace != "" {
- context += "/" + namespace
- }
- return withType("kube", context)
+ return buildKubernetesField(context, namespace)
}
func getKubernetesContext(configPath string) string {
@@ -102,10 +99,17 @@ func getKubernetesFieldViaU8S() string {
namespace = fields[1]
}
}
+ return buildKubernetesField(context, namespace)
+}
+func buildKubernetesField(context, namespace string) string {
if context == "" {
return ""
}
+ if !strings.HasPrefix(context, "qa") {
+ //visual warning when working in a productive region
+ context = withColor("1;41", context)
+ }
if namespace != "" {
context += "/" + namespace
}