Repository navigation
feat(stack): use the exec hints of the server in stack pods, stack exec and the stream commands - #184
Merged
Merged
Conversation
…ec and the stream commands (#183) k8s-stack-manager v0.15.0 sends exec hints (?exec_hints=true on /status and /pods: exec_hints, exec_containers, exec_default_container) and stream_api_keys_allowed in /ui-config. - stack pods: requests the hints (not with -q) and shows an EXEC column after REASON (`web*, worker`, `*` = the container without -c, `-` = no container) when the server sends them; the table is unchanged without hints. -o json/yaml print the fields. Only valid container names are shown; the CHART, POD, PHASE cells and the namespace are sanitized. - stack exec: a refusal with container_not_allowed, container_not_found or service_account_token makes one best-effort /pods?exec_hints=true call and names the accepted containers ("Use -c web or -c worker.") or says that the server lists none for the chart. A failed call leaves the error unchanged; the exit code stays 255. - stack exec and stack port-forward with an API key read the public /ui-config first (no credentials) and stop before the dial when the server does not allow API keys for streams. A missing field or a failed read dials as before; a session makes no extra call. - Ctrl-C during the extra calls: "interrupted before the command started" (exec 130); port-forward binds no port. - U+061C is a bidi control for sanitizing. Vendored swagger refreshed. - Docs: help texts, README, agent guide, CLAUDE.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #183.
Uses what k8s-stack-manager v0.15.0 (omattsson/k8s-stack-manager#728) sends:
?exec_hints=trueon/statusand/pods:exec_hints, plusexec_containersandexec_default_containerper chartstream_api_keys_allowedin/ui-configChanges
stack pods?exec_hints=true; with-qit sends no query.exec_hints: true, the table gets anEXECcolumn afterREASON, so the other columns keep their positions:web*, worker:*marks the container used without-c.-: no container accepts exec.-o jsonand-o yamlprint the fields as the server sends them.web*, adminor one with$(...)can't fake the list or reach a copied shell command.stack execrefusalscontainer_not_allowed,container_not_foundandservice_account_token, stackctl makes one best-effort/pods?exec_hints=truecall. The hint then replaces the generic advice:... Use -c web or -c worker.The-cvalue that was refused is left out, and the list stops at 8 names.... The server lists no container of chart X that accepts exec; ask an administrator.API key check before the dial (
stack exec,stack port-forward)/ui-config, without credentials.stream_api_keys_allowed: false: the command stops before it looks up the stack or dials, with the shared advice to log in. Exec exits 255, port-forward exits 1.true, or the read fails: dial as before.Ctrl-C during these extra calls:
Also
cli/cmd/agent_guide.mdandCLAUDE.md.Tests
make lint: clean.go test -race ./...: all 8 packages ok (3194 passed, 2 skipped helper processes).go vet -tags live ./test/live/: ok.-count=3.stack pods: every output mode, with hints (one container, two, an empty list) and without, and theexec_hints=truequery.stack exec: each refusal code, with a working and with a failing hints call; exit code 255; no extra call for other outcomes./ui-configanswers; no credentials sent; no call with a session; Ctrl-C.Left open (they predate this change)
X-API-Key.stack pods -qprints raw pod names.🤖 Generated with Claude Code