Skip to content

feat(bootstrap): add exec-plugin auth-type support - #90

Merged
onuryilmaz merged 4 commits into
mainfrom
feat/bootstrap-exec-plugin
Nov 18, 2026
Merged

onuryilmaz merged 4 commits into
mainfrom
feat/bootstrap-exec-plugin

Conversation

@onuryilmaz

Copy link
Copy Markdown
Contributor

Summary

  • Adds --auth-type flag to bootstrap command (default: exec-plugin)
  • When exec-plugin: writes a kubelogin get-token exec stanza instead of the legacy auth-provider block
  • When auth-provider: preserves the previous behavior for backward compatibility
  • Adds --kubelogin-path, --kubelogin-extra-args, and --kubelogin-token-cache-dir flags to match sync's kubelogin options

Motivation

Without exec-plugin support, cloudctl sync would 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 test passes
  • bootstrap --auth-type=exec-plugin produces a kubeconfig with exec stanza using kubelogin get-token
  • bootstrap --auth-type=auth-provider produces the legacy auth-provider stanza
  • cloudctl sync works end-to-end after bootstrapping with --auth-type=exec-plugin

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]>
@onuryilmaz
onuryilmaz requested review from a team as code owners November 17, 2026 16:22
Copilot AI balanced review requested due to automatic review settings November 17, 2026 16:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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-type to exec-plugin for 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

Comment thread cmd/bootstrap.go Resolved
Comment thread cmd/bootstrap.go Resolved
Comment thread cmd/bootstrap.go Resolved
- 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]>
@onuryilmaz
onuryilmaz merged commit 35f22af into main Nov 18, 2026
7 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.

2 participants