Skip to content

test(e2e): disable service account token automount in workload fixtures - #387

Merged
yuval-gr merged 1 commit into
mainfrom
test/e2e-disable-sa-token-automount
Sep 22, 2026
Merged

yuval-gr merged 1 commit into
mainfrom
test/e2e-disable-sa-token-automount

Conversation

@rogirun

@rogirun rogirun commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Sets automountServiceAccountToken: false on the pod template of the batch-job, deployment and statefulset e2e fixtures under test/e2e/flows/testdata/. These pods only run busybox sleeping or exiting, and never call the API server, so they do not need the default service account token. The pod fixtures already set this field; this brings the other workload fixtures in line.

Resolves 12 findings of static analysis rule kubernetes:S6865 ("Bind this resource's automounted service account to RBAC or disable automounting"). Recorded data is unaffected; the field does not change any status Karta reads.

Related issue(s)

None. Small fixture hardening that came out of a static analysis scan.

Checklist

  • All commits are signed off with DCO (git commit -s)
  • New/modified files have SPDX license and copyright headers
  • Documentation updated (if applicable)
  • Tests pass (make check)
  • No proprietary or internal information included

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated end-to-end test scenarios for batch jobs, deployments, and stateful sets.
    • Test workload pod templates now explicitly disable automatic service-account token mounting across completed, running, failed, degraded, resumed, scaled, suspended, and initializing states.
    • This ensures test coverage reflects workload configurations where service-account tokens are not automatically mounted.

The batch-job, deployment and statefulset fixtures ran their pods with the
default service account token mounted, though none of them call the API
server. Set automountServiceAccountToken to false on each pod template, as
the pod fixtures already do. Resolves static analysis rule kubernetes:S6865.

Signed-off-by: Roee Gil <roee.gil@run.ai>
@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Enterprise

Run ID: ad96617f-77d9-4547-9748-17fdad0d9da4

📥 Commits

Reviewing files that changed from the base of the PR and between cd09093 and 39211c4.

📒 Files selected for processing (12)
  • test/e2e/flows/testdata/batch-job/completed.yaml
  • test/e2e/flows/testdata/batch-job/degraded.yaml
  • test/e2e/flows/testdata/batch-job/failed.yaml
  • test/e2e/flows/testdata/batch-job/resumed.yaml
  • test/e2e/flows/testdata/batch-job/running.yaml
  • test/e2e/flows/testdata/batch-job/scaled.yaml
  • test/e2e/flows/testdata/batch-job/suspended.yaml
  • test/e2e/flows/testdata/deployment/failed.yaml
  • test/e2e/flows/testdata/deployment/initializing.yaml
  • test/e2e/flows/testdata/deployment/running.yaml
  • test/e2e/flows/testdata/statefulset/degraded.yaml
  • test/e2e/flows/testdata/statefulset/running.yaml

Included review availability: Your plan provides up to 12 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The end-to-end test fixtures for batch Jobs, Deployments, and StatefulSets now set automountServiceAccountToken: false in their pod templates.

Changes

Service Account Token Fixture Updates

Layer / File(s) Summary
Update workload pod templates
test/e2e/flows/testdata/batch-job/*, test/e2e/flows/testdata/deployment/*, test/e2e/flows/testdata/statefulset/*
The affected pod templates disable automatic service-account token mounting.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 39211

This fixture-only security hardening change is ready to merge.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: disabling service-account token automount in workload fixtures.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@yuval-gr
yuval-gr merged commit 55bdc3a into main Sep 22, 2026
7 checks passed
@yuval-gr
yuval-gr deleted the test/e2e-disable-sa-token-automount branch September 22, 2026 19:05
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