Skip to content

Commit 0c3b7d4

Browse files
authored
fix: do not set runAsNonRoot to the init container of datasafed (#9727)
1 parent 760fea1 commit 0c3b7d4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

controllers/dataprotection/backuprepo_controller.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,6 @@ func (r *BackupRepoReconciler) runPreCheckJobForMounting(reconCtx *reconcileCont
776776
}},
777777
SecurityContext: &corev1.SecurityContext{
778778
AllowPrivilegeEscalation: boolptr.False(),
779-
RunAsNonRoot: boolptr.True(),
780779
},
781780
}},
782781
Volumes: []corev1.Volume{{
@@ -788,6 +787,9 @@ func (r *BackupRepoReconciler) runPreCheckJobForMounting(reconCtx *reconcileCont
788787
},
789788
}},
790789
ServiceAccountName: saName,
790+
SecurityContext: &corev1.PodSecurityContext{
791+
RunAsNonRoot: boolptr.True(),
792+
},
791793
},
792794
},
793795
BackoffLimit: pointer.Int32(2),
@@ -856,10 +858,12 @@ datasafed rm %s`, precheckFilePath, precheckFilePath, precheckFilePath),
856858
},
857859
SecurityContext: &corev1.SecurityContext{
858860
AllowPrivilegeEscalation: boolptr.False(),
859-
RunAsNonRoot: boolptr.True(),
860861
},
861862
}},
862863
ServiceAccountName: saName,
864+
SecurityContext: &corev1.PodSecurityContext{
865+
RunAsNonRoot: boolptr.True(),
866+
},
863867
},
864868
},
865869
BackoffLimit: pointer.Int32(2),

pkg/dataprotection/utils/backuprepo.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ func injectDatasafedInstaller(podSpec *corev1.PodSpec) {
155155
VolumeMounts: []corev1.VolumeMount{sharedVolumeMount},
156156
SecurityContext: &corev1.SecurityContext{
157157
AllowPrivilegeEscalation: boolptr.False(),
158-
RunAsNonRoot: boolptr.True(),
159158
},
160159
}
161160
intctrlutil.InjectZeroResourcesLimitsIfEmpty(&initContainer)

0 commit comments

Comments
 (0)