Repository navigation
feat(bootstrap): add exec-plugin auth-type support - #90
Merged
Merged
Conversation
Add --auth-type flag (default: exec-plugin) so bootstrap writes a kubelogin exec stanza instead of the legacy auth-provider block. Also adds --kubelogin-path, --kubelogin-extra-args, and --kubelogin-token-cache-dir flags to match sync's kubelogin options. Signed-off-by: onuryilmaz <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Bootstrap ignores explicit kubelogin flags and the token-cache directory, while the --data path bypasses authentication selection and can preserve the legacy OIDC interactive-login failure.
3 open issues
What changed in this PR
Adds kubelogin exec-plugin authentication to bootstrap, enabling generated Greenhouse kubeconfigs to initiate interactive login while retaining the legacy auth-provider option.
Changes:
- Defaults
--auth-typetoexec-pluginfor kubeconfigs built from individual flags. - Adds kubelogin binary path, extra arguments, and token-cache directory options.
- Adds exec-plugin construction coverage and updates existing tests to explicitly select legacy authentication.
| File | Description |
|---|---|
cmd/bootstrap.go |
Adds authentication options and exec-plugin kubeconfig generation. |
cmd/bootstrap_test.go |
Tests exec-plugin output and adapts legacy tests and flag resets. |
Review effort: Balanced
- Read kubelogin flags from cmd.Flags() before falling back to viper, avoiding cross-command pollution from sync's bindings - Apply exec-plugin conversion to OIDC users when --data blob is used with --auth-type=exec-plugin (default), so bootstrap --data no longer leaves legacy auth-provider credentials - Emit --token-cache-dir unconditionally when tokenCacheDir is set in buildKubeloginArgs; connector_id suffix is still applied when present - Extract defaultOIDCTokenCacheDir() helper to root.go, shared between bootstrap and sync init functions Signed-off-by: onuryilmaz <[email protected]>
… data-blob tests, use existing binary in exec-plugin test Signed-off-by: onuryilmaz <[email protected]>
…tests Signed-off-by: onuryilmaz <[email protected]>
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
--auth-typeflag tobootstrapcommand (default:exec-plugin)exec-plugin: writes akubelogin get-tokenexec stanza instead of the legacyauth-providerblockauth-provider: preserves the previous behavior for backward compatibility--kubelogin-path,--kubelogin-extra-args, and--kubelogin-token-cache-dirflags to matchsync's kubelogin optionsMotivation
Without exec-plugin support,
cloudctl syncwould fail with "No valid id-token, and cannot refresh without refresh-token" because the bootstrapped kubeconfig couldn't trigger an interactive login.Test plan
make testpassesbootstrap --auth-type=exec-pluginproduces a kubeconfig withexecstanza usingkubelogin get-tokenbootstrap --auth-type=auth-providerproduces the legacyauth-providerstanzacloudctl syncworks end-to-end after bootstrapping with--auth-type=exec-plugin