feat: add --exec-interactive-mode to auth update-kubeconfig#221
Merged
Conversation
Add a flag to 'datumctl auth update-kubeconfig' that sets the exec credential plugin's interactiveMode directly, instead of hardcoding IfAvailable. Non-interactive contexts (CI, scripts) have no TTY, so the IfAvailable default leaves callers patching the generated kubeconfig afterward with 'kubectl config set-credentials --exec-interactive-mode=Never'. The new flag lets them set it at the source. Key changes: - Add --exec-interactive-mode flag accepting Never, IfAvailable, Always - Default IfAvailable to preserve existing behavior - Validate the value and error on anything else - Cover default, each valid mode, and rejection with a table test Closes #220
scotwells
approved these changes
Jun 24, 2026
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.
Summary
Adds
--exec-interactive-modetodatumctl auth update-kubeconfig, letting callers set the exec credential plugin'sinteractiveModedirectly instead of the hardcodedIfAvailable.Closes #220.
Why
Non-interactive contexts (CI, scripts) have no TTY. The
IfAvailabledefault forces callers to patch the generated kubeconfig after the fact:In
datum-cloud/infrathat patch is duplicated across ~15 Chainsaw test sites (datum-cloud/infra#2806). This flag removes the need for it.Changes
--exec-interactive-modeacceptingNever/IfAvailable/AlwaysIfAvailable— no behavior change for existing callersValidation
go build ./...,go vet, andgo test ./internal/cmd/auth/all pass.