-
Notifications
You must be signed in to change notification settings - Fork 6
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
pb-6681: Add support for PSA in kdmp job #371
Conversation
- Added check and collected psa info from the namespace - if psa enabled then extracted the uid and gid used by the POD. here the pod is choosen based on whichever PVC is used by that pod - applied those uid and GID to all relevant job pod spec - this is done only if the PSA mode enforced with "restricted" value - for baseline and privilege mode no restriction on UID/GID and default setting of SElinux and secomp is adopted in the POD spec Signed-off-by: Lalatendu Das <[email protected]>
OSS Scan Results:
Total issues: 191 |
License Evaluation Results:
Total License Issues: 20 |
@@ -385,6 +402,15 @@ func jobFor( | |||
}, | |||
} | |||
|
|||
if job.Spec.Template.Spec.SecurityContext != nil { |
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.
We don't require this check , as we are initializing the SecurityContext above . Similarly for all the operations
} | ||
if !psaIsEnforced { | ||
errMsg := fmt.Sprintf("PSA is not enforced in namespace [%s], no need to enforce any uid/gid in job for backing up pvc [%s]", namespace, pvcName) | ||
logrus.Debugf("%s: %v", fn, errMsg) |
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.
Here its a debug , but in the caller we are logging error if PSA is not enforced
|
||
// get Pod from PVC details | ||
func GetPodFromPVC(pvcName, namespace string) (*corev1.Pod, error) { | ||
fn := "GetPodFromPVCName" |
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.
Nit, change it to same as function name
Created a new PR and addressed the review comment given by kesavan in that new PR. That PR is created since we need to vendor a different stork version from private to master. And a lot other changes to be addressed hence made a separate branch and a PR eventually. |
What this PR does / why we need it: this adds the PSA feature to px-backup
Which issue(s) this PR fixes (optional)
Closes # pb-6681
Special notes for your reviewer:
Currently Unit testing, this is a PR to get hold of the code review earlier.
Known Issue : restore path doesn't have a deployment to capture UID and GID, we will use the backupInfo artifacts in mongo to provide that. we should have captured it during backup time.