diff --git a/plugins/kube-ps1/README.md b/plugins/kube-ps1/README.md index da375f379..e00e8b972 100644 --- a/plugins/kube-ps1/README.md +++ b/plugins/kube-ps1/README.md @@ -216,10 +216,10 @@ In case you would like to have more control over kube environment context, you c | `KUBE_ENV_PADDING` | one space | Padding (spaces or characters) added around the environment block | | `KUBE_ENV_OPEN_SYMBOL` | `[` | Opening symbol used for the environment block | | `KUBE_ENV_CLOSE_SYMBOL` | `]` | Closing symbol used for the environment block | -| `KUBE_ENV_PROD` | `prod` | Set default production label | -| `KUBE_ENV_STG` | `stag` | Set default staging label | -| `KUBE_ENV_TEST` | `test` | Set default testing label | -| `KUBE_ENV_DEV` | `dev` | Set default developing label | +| `KUBE_ENV_PROD_LABEL` | `prod` | Set default production label | +| `KUBE_ENV_STG_LABEL` | `stag` | Set default staging label | +| `KUBE_ENV_TEST_LABEL` | `test` | Set default testing label | +| `KUBE_ENV_DEV_LABEL` | `dev` | Set default developing label | | `KUBE_ENV_PROD_RE` | `(production\|prod)-` | Regex used to detect production in the context name | | `KUBE_ENV_STG_RE` | `(staging\|stg)-` | Regex used to detect staging in the context name | | `KUBE_ENV_TEST_RE` | `(testing\|test)-` | Regex used to detect test in the context name | diff --git a/plugins/kube-ps1/kube-ps1.plugin.zsh b/plugins/kube-ps1/kube-ps1.plugin.zsh index dcfc4b6ca..6b4c83182 100644 --- a/plugins/kube-ps1/kube-ps1.plugin.zsh +++ b/plugins/kube-ps1/kube-ps1.plugin.zsh @@ -48,10 +48,10 @@ KUBE_ENV_STG_COLOR="${KUBE_ENV_STG_COLOR:-yellow}" KUBE_ENV_TEST_COLOR="${KUBE_ENV_TEST_COLOR:-green}" KUBE_ENV_DEV_COLOR="${KUBE_ENV_DEV_COLOR:-blue}" -KUBE_ENV_PROD="${KUBE_ENV_PROD:-prod}" -KUBE_ENV_STG="${KUBE_ENV_STG:-stag}" -KUBE_ENV_TEST="${KUBE_ENV_TEST:-test}" -KUBE_ENV_DEV="${KUBE_ENV_DEV:-dev}" +KUBE_ENV_PROD_LABEL="${KUBE_ENV_PROD_LABEL:-prod}" +KUBE_ENV_STG_LABEL="${KUBE_ENV_STG_LABEL:-stag}" +KUBE_ENV_TEST_LABEL="${KUBE_ENV_TEST_LABEL:-test}" +KUBE_ENV_DEV_LABEL="${KUBE_ENV_DEV_LABEL:-dev}" KUBE_ENV_PROD_RE="${KUBE_ENV_PROD_RE:-(production|prod)-}" KUBE_ENV_STG_RE="${KUBE_ENV_STG_RE:-(staging|stg)-}" @@ -349,19 +349,19 @@ _kube_ps1_set_env_ctx() { if grep -qE "${KUBE_ENV_PROD_RE}" <<< "${KUBE_PS1_CONTEXT}"; then _kube_ps1_cut_context "${KUBE_ENV_PROD_RE}" ctx_color="$(_kube_ps1_color_fg "${KUBE_ENV_PROD_COLOR}")" - env_label="${KUBE_ENV_PROD}" + env_label="${KUBE_ENV_PROD_LABEL}" elif grep -qE "${KUBE_ENV_STG_RE}" <<< "${KUBE_PS1_CONTEXT}"; then _kube_ps1_cut_context "${KUBE_ENV_PROD_RE}" ctx_color="$(_kube_ps1_color_fg "${KUBE_ENV_PROD_COLOR}")" - env_label="${KUBE_ENV_PROD}" + env_label="${KUBE_ENV_PROD_LABEL}" elif grep -qE "${KUBE_ENV_TEST_RE}" <<< "${KUBE_PS1_CONTEXT}"; then _kube_ps1_cut_context "${KUBE_ENV_TEST_RE}" ctx_color="$(_kube_ps1_color_fg "${KUBE_ENV_TEST_COLOR}")" - env_label="${KUBE_ENV_TEST}" + env_label="${KUBE_ENV_TEST_LABEL}" elif grep -qE "${KUBE_ENV_DEV_RE}" <<< "${KUBE_PS1_CONTEXT}"; then _kube_ps1_cut_context "${KUBE_ENV_DEV_RE}" ctx_color="$(_kube_ps1_color_fg "${KUBE_ENV_DEV_COLOR}")" - env_label="${KUBE_ENV_DEV}" + env_label="${KUBE_ENV_DEV_LABEL}" fi KUBE_PS1+="${KUBE_ENV_OPEN_SYMBOL}${ctx_color}${env_label}${KUBE_PS1_RESET_COLOR}${KUBE_ENV_CLOSE_SYMBOL}"