Repository navigation
Allow Session service account updates - #1774
Merged
Merged
Conversation
There was a problem hiding this comment.
1 issue found across 10 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="internal/controller/session_runtime_access.go">
<violation number="1" location="internal/controller/session_runtime_access.go:76">
P2: The new no-Pod preservation path does not run when the runtime RoleBinding is recreated, because the create path returns before `if !podFound`. A service-account transition during a Pod/cache gap can therefore drop the old Pod’s permissions and leave the drain waiting indefinitely; retain the previous account when recreating the binding, using the current StatefulSet template or another persisted source.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Collaborator
Author
|
/kelos review |
Contributor
|
🤖 Kelos Task Status Task |
Contributor
|
🤖 Kelos Reviewer Agent @gjkim42 Review SummaryVerdict: COMMENT Findings Overview
FindingsSecurity
Correctness / Diagnostics
Suggestions (optional)
Key takeaways
|
gjkim42
force-pushed
the
allow-session-service-account-updates
branch
from
September 29, 2026 14:14
16e1c6b to
4bcd679
Compare
gjkim42
enabled auto-merge
September 29, 2026 14:21
This was referenced Sep 29, 2026
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.
What type of PR is this?
/kind api
What this PR does / why we need it:
Sessions reject changes to
spec.worker.podOverrides.serviceAccountNamebecause replacing the runtime RoleBinding's subject can remove the running Pod's permission to acknowledge draining.Allow service-account changes through the existing drain-and-replace flow. Authorize both the desired account and the observed Pod's account during the transition, then remove the previous account when the replacement Pod is observed. If no owned Pod is visible, retain the current StatefulSet template's account when creating or repairing the RoleBinding and preserve its existing Session-scoped grants. Unrelated Pods do not affect runtime permissions or preempt the controller's existing Pod-conflict and suspension handling. Clearing the override selects the managed service account.
Remove the immutability validation, regenerate CRDs, and clarify that inherited Kubernetes descriptions such as "Cannot be updated" describe existing Pods rather than Session overrides. Cover account transitions, repeated edits, terminating and absent Pods, RoleBinding recreation during a Pod gap, unrelated Pods, and suspended updates; extend the live drain end-to-end test to change service accounts.
Document the authorization contract explicitly: the runtime and agent share the Pod's token and can patch the Session spec, including its service account. Agents must therefore be trusted to select service accounts in their namespace. This PR does not add operator-only admission enforcement; deployments requiring that restriction must provide an admission policy.
Which issue(s) this PR is related to:
N/A
Special notes for your reviewer:
make verifypassed.make test-integration TEST_FLAGS=-p=2: all 12 install/upgrade specs passed. One controller/API run hit a Task test cache-ordering failure (github-tokenSecret was not yet visible to the Task controller); all Session specs passed.make test-integration TEST_FLAGS='-p=1 -run=^TestIntegration$'passed on retry: all 161 controller/API specs, without product or test changes for the unrelated timing failure.make test TEST_FLAGS="-p=2 -run='^(TestSession|TestEnsureSession)'"passed.env -u CODEX_HOME -u CODEX_AUTH_JSON make test TEST_FLAGS=-p=2passed. Unsetting the ambient agent home and authentication variables isolates the entrypoint tests from this Session's environment.Does this PR introduce a user-facing change?