Restore y-kubeconfig-import#78
Conversation
solsson
left a comment
There was a problem hiding this comment.
-
set -euo pipefail (i.e. add -u) catches typo'd env-var reads. Would need [ -z "${DEBUG:-}" ] on line 2 and [ -z "${KUBECONFIG:-}" ] on line 11 to coexist with set -u, since the current [ -z "$VAR" ] form errors on unset variables under -u.
-
With KUBECONFIG="$CONFTEMP:$KUBECONFIG", the merge picks up current-context from CONFTEMP — so importing flips the operator's active context to whatever the imported file pointed at. That's the right semantic for "import + start using this cluster" but it'll surprise an operator who just wanted to add the entry without disturbing their current workflow. Worth a one-line # note: current-context becomes whatever CONFTEMP set comment so the behaviour is documented at the call site.
…ontext flip Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The DEBUG pattern check only matched the literal [ -z "$DEBUG" ] form, so
adding set -u (which requires the ${DEBUG:-} guard) flipped the debug check
true->false and was reported as a degradation. Accept both forms.
Document the guarded form in Y_SCRIPT_AUTHORING.md.
${DEBUG:-} is valid in plain bash/sh and POSIX, so make it the canonical
DEBUG-trace form; the bare $DEBUG form stays tolerated by y-script-lint.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
I'm not sure 9b60ed6 (#76) is correct that all cluster tooling has been replaced by y-cluster
Update: It wasn't, and it makes sense that
y-cluster kubeconfigshould not have this kind of tool that is unrelated to provisioning.