Repository navigation
Conversation
The webhook injects sidecar containers without SecurityContext, causing CreateContainerConfigError on pods with runAsNonRoot: true. client-registration: Set runAsUser=65534 (nobody), runAsNonRoot=true, drop all capabilities. The Python registration script does not need root privileges. spiffe-helper: Explicitly set runAsUser=0 with runAsNonRoot=false. The upstream image runs as root and needs socket access. Document this like the proxy-init container which uses the same pattern. Fixes rossoctl/rossoctl#611 Signed-off-by: Ladislav Smola <[email protected]> Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> Signed-off-by: Ladislav Smola <[email protected]>
Author
|
jsut a try, complete fix is in #100 |
esnible
added a commit
to esnible/cortex
that referenced
this pull request
Sep 10, 2026
The list-shape heuristics did not separate a rekey from an eviction, and the comment above them asserted a safety property the code lacked. Reproduced before changing anything. Append evicts only when the count EXCEEDS max_sessions and evictOldestLocked removes exactly one entry, so at capacity session rossoctl#101 arriving means one id vanishes and one appears with the length unchanged. A stale "default" is the prime candidate (it is spared only while it is activeID). All three guards then passed and default's 3 events were filed under an unrelated session, SessionID rewritten — the exact outcome the comment claimed was prevented, in the case the banner calls "evicted". Not contrived: it is the steady state at capacity. CreatedAt is a real discriminator, as the reviewer noted. Store.Rekey renames in place on the same *entry, so a rekeyed session reports default's original CreatedAt, while a fresh session gets CreatedAt: now. Verified end to end rather than by reading: driving the real store through the JSON encoder and decoding as apiclient does confirms the rekeyed id preserves the timestamp and a new id does not. rekeyedTo now gates on that equality, which makes the length and prior-membership checks redundant — both removed along with soleNewSession/hasSession. The .Equal() detail is load-bearing and also verified: after a JSON round trip, == on the same instant returns FALSE while .Equal() returns true. Using == would have silently disabled migration rather than failing loudly. Covered by a test that re-parses an RFC3339 timestamp. Two existing rekey tests were under-specifying the store: they built summaries with no CreatedAt, which no real rekey produces. Updated to carry it, so they model what Rekey actually does. Refs rossoctl#870 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Ed Snible <[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
SecurityContextto injected sidecar containers to fixCreateContainerConfigErroron pods withrunAsNonRoot: truekagenti-client-registration:runAsUser: 65534(nobody),runAsNonRoot: true, drop all capabilitiesspiffe-helper: ExplicitlyrunAsUser: 0,runAsNonRoot: false(upstream image requires root for SPIRE socket access, documented like proxy-init)Problem
When the webhook injects the
kagenti-client-registrationsidecar, it has noSecurityContext. If the pod hasrunAsNonRoot: true(set by the webhook itself or security policies), the container fails with:Fix
Add explicit
SecurityContextto both injected sidecars incontainer_builder.go, following the pattern already used by theenvoy-proxyandproxy-initcontainers.Test plan
client-registrationcontainer starts successfully on pods withrunAsNonRoot: truespiffe-helperstarts on SPIRE-enabled clustersFixes rossoctl/rossoctl#611
🤖 Generated with Claude Code