my-homelab-configs/lib/jeannie/cluster-context.sh

16 lines
491 B
Bash

#!/usr/bin/env bash
cluster_context_require() {
python3 "${REPO_ROOT}/scripts/cluster-context.py" check \
--profile "${LAB_CLUSTER_PROFILE:?Missing active cluster profile}" \
--kubeconfig "${KUBECONFIG_PATH}" >/dev/null
}
cluster_context_enable() {
export HOMELAB_STATE_DIR LAB_CLUSTER_PROFILE KUBECONFIG_PATH
case ":${PATH}:" in
*":${REPO_ROOT}/scripts/guarded-bin:"*) ;;
*) export PATH="${REPO_ROOT}/scripts/guarded-bin:${PATH}" ;;
esac
}