@@ -759,7 +759,6 @@ func (r *BackupRepoReconciler) runPreCheckJobForMounting(reconCtx *reconcileCont
759759 job .Name = reconCtx .preCheckResourceName ()
760760 job .Namespace = namespace
761761 _ , err = createObjectIfNotExist (reconCtx .Ctx , r .Client , job , func () error {
762- runAsUser := int64 (0 )
763762 job .Spec = batchv1.JobSpec {
764763 Template : corev1.PodTemplateSpec {
765764 Spec : corev1.PodSpec {
@@ -777,7 +776,7 @@ func (r *BackupRepoReconciler) runPreCheckJobForMounting(reconCtx *reconcileCont
777776 }},
778777 SecurityContext : & corev1.SecurityContext {
779778 AllowPrivilegeEscalation : boolptr .False (),
780- RunAsUser : & runAsUser ,
779+ RunAsNonRoot : boolptr . True () ,
781780 },
782781 }},
783782 Volumes : []corev1.Volume {{
@@ -838,7 +837,6 @@ func (r *BackupRepoReconciler) runPreCheckJobForTool(reconCtx *reconcileContext,
838837 job .Name = reconCtx .preCheckResourceName ()
839838 job .Namespace = namespace
840839 _ , err = createObjectIfNotExist (reconCtx .Ctx , r .Client , job , func () error {
841- runAsUser := int64 (0 )
842840 job .Spec = batchv1.JobSpec {
843841 Template : corev1.PodTemplateSpec {
844842 Spec : corev1.PodSpec {
@@ -858,7 +856,7 @@ datasafed rm %s`, precheckFilePath, precheckFilePath, precheckFilePath),
858856 },
859857 SecurityContext : & corev1.SecurityContext {
860858 AllowPrivilegeEscalation : boolptr .False (),
861- RunAsUser : & runAsUser ,
859+ RunAsNonRoot : boolptr . True () ,
862860 },
863861 }},
864862 ServiceAccountName : saName ,
0 commit comments