feat: add --format selector with real Kubernetes ExecCredential output#39
Merged
Merged
Conversation
Replaces the boolean --all toggle with a --format selector (token|json|exec-credential). Adds a genuine Kubernetes ExecCredential envelope honoring --token-type and echoing KUBERNETES_EXEC_INFO apiVersion. Keeps --all as a deprecated alias for --format=json.
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.
Replaces the boolean `--all` toggle with a `--format` selector offering three output modes: `token` (default, bare token), `json` (the full JSON document, unchanged), and `exec-credential`. The new `exec-credential` mode emits a genuine Kubernetes `client.authentication.k8s.io` ExecCredential envelope (`apiVersion`/`kind`/`status.token`) that honors `--token-type` and echoes the apiVersion from `KUBERNETES_EXEC_INFO` (falling back to `v1`), so it works as a real kubectl exec-credential drop-in — the previous flat `--all` output would have been rejected by kubectl. `--all` is retained as a deprecated alias for `--format=json`, so existing 0.9.0 users are unaffected. Adds unit/config/cmd tests for the new writer, apiVersion resolution, format parsing, and the `--all` alias, and rewrites the kubectl section plus flags table in the README.