rig major updates
This commit is contained in:
@@ -22,11 +22,19 @@ derive() {
|
||||
}
|
||||
|
||||
# Resolved facts for consumers outside bash, space-separated, positional:
|
||||
# CLUSTER KUBECONTEXT HTTP HTTPS TILT REGISTRY MANIFESTS_DIR
|
||||
# Read this, not `derive` (which ignores ctrl/.env).
|
||||
# CLUSTER KUBECONTEXT HTTP HTTPS TILT REGISTRY MANIFESTS_DIR OVERLAY_DIR
|
||||
# The two paths are absolute, or - when there is none. Read this, not `derive`.
|
||||
active() {
|
||||
load_config
|
||||
echo "$CLUSTER $KUBECONTEXT $HTTP_PORT $HTTPS_PORT $TILT_PORT $REGISTRY_PORT $MANIFESTS_DIR"
|
||||
local m="-" o="-"
|
||||
if [ -n "$MANIFESTS_DIR" ]; then m=$(_abs_from_ctrl "$MANIFESTS_DIR"); fi
|
||||
if [ -n "$OVERLAY_DIR" ]; then o=$(_abs_from_ctrl "$OVERLAY_DIR"); fi
|
||||
case "$m$o" in
|
||||
*[[:space:]]*)
|
||||
echo "a path here holds whitespace, and these facts are split on spaces: $m $o" >&2
|
||||
exit 1 ;;
|
||||
esac
|
||||
echo "$CLUSTER $KUBECONTEXT $HTTP_PORT $HTTPS_PORT $TILT_PORT $REGISTRY_PORT $m $o"
|
||||
}
|
||||
|
||||
show() {
|
||||
@@ -55,6 +63,13 @@ _row() {
|
||||
# rewritten — an override stays an override.
|
||||
persist() {
|
||||
derive
|
||||
# ctrl/.env belongs to this rig, not to an overlay: a pin written now would
|
||||
# follow every overlay this rig later runs, and two of them would collide.
|
||||
if [ -n "${OVERLAY:-}" ]; then
|
||||
echo "not pinning: OVERLAY is set, and ctrl/.env would carry this block to every overlay" >&2
|
||||
echo " its ports stay derived from its folder name ($CLUSTER): $DERIVED_HTTP-$DERIVED_REGISTRY" >&2
|
||||
exit 1
|
||||
fi
|
||||
[ -f ./.env ] || cp ./.env.example ./.env
|
||||
|
||||
local wrote=0 key val
|
||||
|
||||
Reference in New Issue
Block a user