Skip to content

feat: allow setting securityContext for runner pods - #1068

Merged
corrieriluca merged 3 commits into
mainfrom
issue-905-runner-security-context
Sep 4, 2026
Merged

feat: allow setting securityContext for runner pods#1068
corrieriluca merged 3 commits into
mainfrom
issue-905-runner-security-context

Conversation

@DjinnS

@DjinnS DjinnS commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add PodSecurityContext/SecurityContext to OverrideRunnerSpec, settable per TerraformRepository/TerraformLayer (layer overrides repository, same precedence as Affinity/Resources).
  • Add matching defaults in RunnerConfig, exposed via the Helm chart as config.burrito.runner.podSecurityContext / config.burrito.runner.securityContext, so a cluster-wide default can be set on top of which repo/layer overrides apply.

Closes #905

Test plan

  • go build ./... / go vet ./...
  • go test ./api/... and ./internal/controllers/terraformrun/... (added cases for repo-only/layer-only/both/neither override precedence, and an envtest case asserting the pod/container securityContext is applied)
  • helm lint and helm template with config.burrito.runner.securityContext/podSecurityContext set, verified the ConfigMap renders the new keys

Guillaume Leccese added 2 commits September 2, 2026 13:59
Runner pods had no way to set a pod or container securityContext,
either from the Helm chart or per TerraformLayer/TerraformRepository
(#905). Add PodSecurityContext/SecurityContext to OverrideRunnerSpec
and RunnerConfig, merged the same way as Resources/Affinity, layer
overriding repository overriding the Helm-wide default.
Expose config.burrito.runner.podSecurityContext and .securityContext
in values.yaml so a cluster-wide default can be set for runner pods,
on top of the per-layer/repository override added in the API.
@github-project-automation github-project-automation Bot moved this to 📋 Backlog in Burrito Sep 2, 2026
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.66%. Comparing base (7edffe2) to head (52f8038).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1068      +/-   ##
==========================================
+ Coverage   51.38%   51.66%   +0.28%     
==========================================
  Files          99       99              
  Lines        5566     5586      +20     
==========================================
+ Hits         2860     2886      +26     
+ Misses       2706     2700       -6     

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@corrieriluca corrieriluca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The securityContext and podSecurityContext should only be set in overrideRunnerSpec, not in Burrito's config / values.

Comment thread internal/burrito/config/config.go Outdated
Comment thread internal/controllers/terraformrun/pod.go Outdated
Keep securityContext/podSecurityContext for runner pods settable only
through spec.overrideRunnerSpec on TerraformRepository/TerraformLayer,
consistent with every other runner pod field (Resources, Affinity,
Tolerations, ...). Remove the parallel Helm/config-level default that
was added alongside it, per review feedback on #1068.
@DjinnS

DjinnS commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@corrieriluca Good point, thanks — pushed 52f8038 which drops config.burrito.runner.podSecurityContext/.securityContext from values.yaml and RunnerConfig entirely. securityContext/podSecurityContext for runner pods are now only settable via spec.overrideRunnerSpec on TerraformRepository/TerraformLayer, same as Resources/Affinity/Tolerations.

@corrieriluca corrieriluca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@corrieriluca
corrieriluca merged commit 3417619 into main Sep 4, 2026
18 checks passed
@github-project-automation github-project-automation Bot moved this from 📋 Backlog to ✅ Done in Burrito Sep 4, 2026
@corrieriluca
corrieriluca deleted the issue-905-runner-security-context branch September 4, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

option to set securityContext for burrito runner pod

2 participants