Skip to content

Restore y-kubeconfig-import#78

Merged
solsson merged 3 commits into
mainfrom
y-kubeconfig-import
Jun 5, 2026
Merged

Restore y-kubeconfig-import#78
solsson merged 3 commits into
mainfrom
y-kubeconfig-import

Conversation

@solsson
Copy link
Copy Markdown
Collaborator

@solsson solsson commented Jun 4, 2026

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 kubeconfig should not have this kind of tool that is unrelated to provisioning.

Copy link
Copy Markdown
Collaborator Author

@solsson solsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 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.

  2. 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.

solsson and others added 2 commits June 5, 2026 10:02
…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>
@solsson solsson merged commit 68db391 into main Jun 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant