Skip to content

fix(backup): apply configured podSecurityContext to backup CronJob#1655

Open
snecklifter wants to merge 1 commit into
devfile:mainfrom
snecklifter:fix/backup-cronjob-podsecuritycontext
Open

fix(backup): apply configured podSecurityContext to backup CronJob#1655
snecklifter wants to merge 1 commit into
devfile:mainfrom
snecklifter:fix/backup-cronjob-podsecuritycontext

Conversation

@snecklifter

Copy link
Copy Markdown

Summary

  • Apply podSecurityContext from DevWorkspaceOperatorConfig to backup Job pod template
  • Consistent with how workspace deployments and PVC cleanup jobs apply the same config field
  • When podSecurityContext is not configured (nil), behavior is unchanged from current

Fixes #1636

Test plan

  • Unit test verifies backup Job uses configured podSecurityContext (custom FSGroupChangePolicy and SELinuxOptions)
  • Unit test verifies podSecurityContext is nil when not configured
  • All existing backup controller tests pass (go test ./controllers/backupcronjob/...)
  • go vet clean

Assisted-by: Claude Code

The backup CronJob controller does not set podSecurityContext on the
backup Job pod spec, even though DevWorkspaceOperatorConfig documents
that podSecurityContext applies to all workspace-related pods. This can
cause permission or SELinux failures when the backup container reads
workspace PVC data on clusters with a custom podSecurityContext.

Apply the configured podSecurityContext from DevWorkspaceOperatorConfig
to the backup Job pod template, consistent with workspace deployments
and PVC cleanup jobs.

Fixes: devfile#1636

Assisted-by: Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Chris Brown <chribrow@redhat.com>
@openshift-ci

openshift-ci Bot commented Jun 19, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: snecklifter
Once this PR has been reviewed and has the lgtm label, please assign dkwon17 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@snecklifter, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 58 minutes and 34 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4912faa1-2042-4397-b23b-847c531d73e4

📥 Commits

Reviewing files that changed from the base of the PR and between cdc8050 and 5280032.

📒 Files selected for processing (2)
  • controllers/backupcronjob/backupcronjob_controller.go
  • controllers/backupcronjob/backupcronjob_controller_test.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci

openshift-ci Bot commented Jun 19, 2026

Copy link
Copy Markdown

Hi @snecklifter. Thanks for your PR.

I'm waiting for a devfile member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backup CronJob should apply DevWorkspaceOperatorConfig podSecurityContext

1 participant