Open
Conversation
Copilot started reviewing on behalf of
Patrick Derks (TrayserCassa)
April 16, 2026 14:52
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a shared “restricted” container security context and applies it across operator-managed Deployments/Jobs/CronJobs to better align generated workloads with hardened Kubernetes security settings.
Changes:
- Introduces
util.RestrictedContainerSecurityContext()and wires it into multiple controllers’ container specs. - Adds unit tests to assert the new container-level security context is applied (jobs + cronjob).
- Adds a kubebuilder default annotation for
podSecurityContextonContainerSpec.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/util/security.go | Adds helper to generate a restricted corev1.SecurityContext for containers. |
| internal/job/snapshot.go | Applies restricted container security context to snapshot job container. |
| internal/job/snapshot_test.go | New test asserting snapshot job uses restricted container security context. |
| internal/job/setup.go | Applies restricted container security context to setup job container. |
| internal/job/setup_test.go | Adds assertions that setup job container uses restricted container security context. |
| internal/job/migration.go | Applies restricted container security context to migration job container. |
| internal/job/migration_test.go | Adds assertions that migration job container uses restricted container security context. |
| internal/job/command.go | Applies restricted container security context to command job container spec. |
| internal/job/command_test.go | Adds assertions that command job + cronjob containers use restricted container security context. |
| internal/cronjob/scheduled_task.go | Applies restricted container security context to scheduled-task cronjob container. |
| internal/cronjob/scheduled_task_test.go | New test asserting scheduled-task cronjob uses restricted container security context. |
| internal/deployment/storefront.go | Applies restricted container security context to storefront deployment container. |
| internal/deployment/storefront_test.go | Updates storefront security-context test expectations. |
| internal/deployment/worker.go | Applies restricted container security context to worker deployment container. |
| internal/deployment/admin.go | Applies restricted container security context to admin deployment container. |
| api/v1/store.go | Adds kubebuilder default for podSecurityContext on ContainerSpec. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bb20866 to
c8884c5
Compare
c8884c5 to
575d171
Compare
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.
No description provided.