Skip to content

Conversation

@vineeth-thumma
Copy link
Contributor

@vineeth-thumma vineeth-thumma commented Feb 9, 2026

Fix bug - > PoP token support crashes with nil pointer in cache.Replace when running non-root

#734

kubelogin v0.2.14 panics with a nil pointer dereference in cache.(*Cache).Replace when PoP tokens are enabled and cache creation fails (typically non-root users or container environments without keyring access).

Root Cause
A Go nil-interface semantics bug. When NewCache() fails, a typed nil *popcache.Cache was stored in Options and later returned by GetPoPTokenCache(). When this typed nil was passed to an interface-typed parameter cache.ExportReplace, Go wrapped it into a non-nil interface (it carries type info). The downstream nil guard if cache != nil passed, MSAL received the nil-wrapping cache, and called Replace() on a nil receiver → panic.

@codecov-commenter
Copy link

codecov-commenter commented Feb 9, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.31%. Comparing base (15edb67) to head (7fe0c8f).
⚠️ Report is 70 commits behind head on main.

Files with missing lines Patch % Lines
pkg/internal/token/execCredentialPlugin.go 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #736      +/-   ##
==========================================
- Coverage   63.43%   57.31%   -6.13%     
==========================================
  Files          37       47      +10     
  Lines        2210     2448     +238     
==========================================
+ Hits         1402     1403       +1     
- Misses        733      880     +147     
- Partials       75      165      +90     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

3 participants