-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy SecurityContext from Containers[0] if present for PVR #8712
Copy SecurityContext from Containers[0] if present for PVR #8712
Conversation
9125c38
to
6c01dfb
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8712 +/- ##
==========================================
- Coverage 59.48% 59.46% -0.03%
==========================================
Files 371 371
Lines 40191 40199 +8
==========================================
- Hits 23909 23905 -4
- Misses 14789 14799 +10
- Partials 1493 1495 +2 ☔ View full report in Codecov by Sentry. |
} | ||
} | ||
// if first container in pod has a SecurityContext set, then copy this security context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The log message printed in line 165 could be misleading, maybe just remove "Using default securityContext values" in the sentence?
@sseago This change makes sense to me, is it convenient to add a UT? |
Signed-off-by: Scott Seago <[email protected]>
21db5f8
6c01dfb
to
21db5f8
Compare
@reasonerjt unit test added |
Thank you for contributing to Velero!
Please add a summary of your change
Velero 1.15.1 added a change to set a default SecurityContext on the fs-backup InitContainer to fix a bug related to pod security standards enforcement. In an OpenShift environment, when the pod was created by a non-admin user, using this default SecurityContext with runAsUser set based on the current (velero) user breaks because this forces the openshift.io/scc annotation to the default privileged level of the velero SA.
The fix is to use the SecurityContext from the first pod container if that container has a SecurityContext set, using the default otherwise.
Does your change fix a particular issue?
Fixes #8711
Please indicate you've done the following:
make new-changelog
) or comment/kind changelog-not-required
on this PR.site/content/docs/main
.