Uh oh!
There was an error while loading. Please reload this page.
fix(cli): show the real (server-capped) ingestor token expiry (#4) - #177
Merged
Conversation
…e requested one (#4) `cluster info` printed the REQUESTED token lifetime ("expires in ~10m0s (server may cap shorter)"), computed from ExpirationSeconds — even when kube-apiserver's --service-account-max-token-expiration capped the grant shorter. The customer saw a lifetime the token doesn't actually have. The TokenRequest response already carries the authoritative expiry (TokenRequestStatus.ExpirationTimestamp, capped by policy) — no JWT parsing needed, contrary to the issue title. Capture it as IngestorToken.ExpiresAt; `cluster info` shows the real remaining lifetime when set, falls back to the requested value when the server didn't return a timestamp, and still reads "never" for the long-lived static-secret fallback (ExpiresAt stays zero there). Tests: token_test.go — CapturesServerExpiry (server caps 3600→300, asserts ExpiresAt reflects the cap), StaticSecretHasNoExpiresAt (zero → "never"). Full internal suite + vet + gofmt green. Low priority per the issue (tokens are short-lived, so the misleading window is small) — but a cheap correctness win now that the API value is right there. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
saadqbal
commented
Jul 8, 2026
Collaborator
Clean fix 👍 — reading |
saadqbal
approved these changes
Jul 8, 2026
Uh oh!
There was an error while loading. Please reload this page.
saadqbal
commented
Jul 8, 2026
Collaborator
/fr-pass |
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 freeto 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.
Closes#4.
Problem
tracebloc cluster infoprinted the requested token lifetime —expires in ~10m0s (server may cap shorter)fromExpirationSeconds— even when kube-apiserver's--service-account-max-token-expirationcapped the grant shorter. The customer saw a lifetime the token doesn't have.Fix (not the issue's JWT approach — better)
The TokenRequest response already carries the authoritative expiry (
TokenRequestStatus.ExpirationTimestamp, capped by policy). No JWT parsing, no new dependency. Capture it asIngestorToken.ExpiresAt:ExpiresAtset →cluster infoshows~<time.Until(ExpiresAt)>(the real remaining lifetime;~hedges client/server clock skew);~10m0s (requested; server may cap shorter));ExpiresAtstays zero → still readsnever.Tests (
internal/cluster/token_test.go)CapturesServerExpiry— reactor caps 3600→300s; assertsExpiresAtreflects the cap (the exact Show real token expiry by parsing the JWTexpclaim instead of the requested value #4 scenario).StaticSecretHasNoExpiresAt— fallback path → zeroExpiresAt→never.Full
internal/...suite +go vet+gofmtgreen.Low priority per the issue (short-lived tokens = small misleading window), but a cheap correctness win. Touches
token.go+ thecluster infodisplay; only textual overlap with #7 (also in cluster/token files, different regions).🤖 Generated with Claude Code