Commit 5f69286 Jacob Woffenden
authored
1 parent c42b586 commit 5f69286 Copy full SHA for 5f69286
File tree 4 files changed +31
-15
lines changed
cloud-platform/src/home/vscode/.devcontainer/promptrc.d
src/home/vscode/.devcontainer/promptrc.d
4 files changed +31
-15
lines changed Original file line number Diff line number Diff line change 8
8
9
9
PROMPT+=' `\
10
10
CURRENT_CONTEXT=$(kubectl config current-context 2>/dev/null); \
11
- CURRENT_NAMESPACE=$(kubectl config view --minify --output "jsonpath={..namespace}"); \
11
+ CURRENT_NAMESPACE=$(kubectl config view --minify --output "jsonpath={..namespace}" 2>/dev/null ); \
12
12
CURRENT_CLIENT_ID=$(kubectl config view --output json | jq -r ".users[0].user[\"auth-provider\"].config[\"client-id\"]"); \
13
13
SERVER_VERSION=$(kubectl version --output json 2>/dev/null | jq -r .serverVersion.gitVersion); \
14
14
if [[ "${CURRENT_CONTEXT}" == "cloud-platform-live" ]] && [[ "${CURRENT_CLIENT_ID}" == "REPLACE_WITH_CLIENT_ID" ]]; then \
Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
10
10
## [ Unreleased]
11
11
12
+ ## [ 1.0.2] - 2024-10-28
13
+
14
+ - Updated environment colour map
15
+
12
16
## [ 1.0.1] - 2024-05-23
13
17
14
18
### Changed
Original file line number Diff line number Diff line change 1
1
{
2
2
"id" : " kubernetes" ,
3
- "version" : " 1.0.1 " ,
3
+ "version" : " 1.0.2 " ,
4
4
"name" : " Kubernetes" ,
5
5
"description" : " Installs the Kubernetes CLI, Helm CLI and Helm Chart Testing CLI" ,
6
6
"options" : {
Original file line number Diff line number Diff line change 2
2
# shellcheck disable=SC2016
3
3
4
4
PROMPT+=' `\
5
- export KUBE_CURRENT_CONTEXT=$(kubectl config current-context 2>/dev/null); \
6
- export KUBE_CURRENT_NAMESPACE=$(kubectl config view --minify --output "jsonpath={..namespace}" 2>/dev/null); \
7
- if [[ "${KUBE_CURRENT_CONTEXT}" == *"development"* ]]; then \
8
- echo -n "[ context: %{$fg[green]%}${KUBE_CURRENT_CONTEXT}%{$reset_color%} ] "; \
9
- elif [[ "${KUBE_CURRENT_CONTEXT}" == *"production"* ]]; then \
10
- echo -n "[ context: %{$fg[red]%}${KUBE_CURRENT_CONTEXT}%{$reset_color%} ] "; \
11
- elif [[ ! -z "${KUBE_CURRENT_CONTEXT}" ]]; then \
12
- echo -n "[ context: %{$fg[yellow]%}${KUBE_CURRENT_CONTEXT}%{$reset_color%} ] "; \
13
- fi \
14
- && \
15
- if [[ ! -z "${KUBE_CURRENT_NAMESPACE}" ]]; then \
16
- echo -n "[ namespace: %{$fg[white]%}${KUBE_CURRENT_NAMESPACE}%{$reset_color%} ] "; \
17
- fi \
5
+ CURRENT_CONTEXT=$(kubectl config current-context 2>/dev/null); \
6
+ CURRENT_NAMESPACE=$(kubectl config view --minify --output "jsonpath={..namespace}" 2>/dev/null); \
7
+ case ${CURRENT_CONTEXT} in \
8
+ *"development"*|*"sandbox"*) \
9
+ colour=green \
10
+ ;; \
11
+ *"test"*) \
12
+ colour=blue \
13
+ ;; \
14
+ *"preproduction"*) \
15
+ colour=yellow \
16
+ ;; \
17
+ *"production"*) \
18
+ colour=red \
19
+ ;; \
20
+ *) \
21
+ colour=white \
22
+ ;; \
23
+ esac; \
24
+ if [[ ! -z ${CURRENT_CONTEXT} ]]; then \
25
+ echo -n "[ context: %{$fg[$colour]%}${CURRENT_CONTEXT}%{$reset_color%} ] "; \
26
+ fi; \
27
+ if [[ ! -z ${CURRENT_NAMESPACE} ]]; then \
28
+ echo -n "[ namespace: ${CURRENT_NAMESPACE} ] "; \
29
+ fi
18
30
`'
You can’t perform that action at this time.
0 commit comments