Skip to content

Commit 8996277

Browse files
mnenciajlong49
andauthored
Avoid setting RunAsNonRoot to false explicitly (cloudnative-pg#923)
Setting RunAsNonRoot explicitly to false is not only redundant, but it could trigger errors. Closes cloudnative-pg#922 Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Signed-off-by: John Long <john.long@enterprisedb.com> Co-authored-by: John Long <john.long@enterprisedb.com>
1 parent 01706a6 commit 8996277

File tree

4 files changed

+0
-10
lines changed

4 files changed

+0
-10
lines changed

tests/utils/azurite.go

-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ func getAzuriteClientPod(namespace string) corev1.Pod {
150150
SecurityContext: &corev1.SecurityContext{
151151
AllowPrivilegeEscalation: pointer.Bool(false),
152152
SeccompProfile: &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault},
153-
RunAsNonRoot: pointer.Bool(false),
154153
},
155154
},
156155
},
@@ -177,7 +176,6 @@ func getAzuriteClientPod(namespace string) corev1.Pod {
177176
},
178177
},
179178
SecurityContext: &corev1.PodSecurityContext{
180-
RunAsNonRoot: pointer.Bool(false),
181179
SeccompProfile: &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault},
182180
},
183181
},

tests/utils/curl.go

-4
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,13 @@ func CurlClient(namespace string) corev1.Pod {
4141
SecurityContext: &corev1.SecurityContext{
4242
AllowPrivilegeEscalation: pointer.Bool(false),
4343
SeccompProfile: &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault},
44-
// Curl image doesn't have a numeric user, so it cannot have RunAsNonRoot set to true
45-
RunAsNonRoot: pointer.Bool(false),
4644
},
4745
},
4846
},
4947
DNSPolicy: corev1.DNSClusterFirst,
5048
RestartPolicy: corev1.RestartPolicyAlways,
5149
SecurityContext: &corev1.PodSecurityContext{
5250
SeccompProfile: &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault},
53-
// Curl image doesn't have a numeric user, so it cannot have RunAsNonRoot set to true
54-
RunAsNonRoot: pointer.Bool(false),
5551
},
5652
},
5753
}

tests/utils/minio.go

-2
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,10 @@ func MinioDefaultDeployment(namespace string, minioPVC corev1.PersistentVolumeCl
190190
SecurityContext: &corev1.SecurityContext{
191191
AllowPrivilegeEscalation: pointer.Bool(false),
192192
SeccompProfile: &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault},
193-
RunAsNonRoot: pointer.Bool(false),
194193
},
195194
},
196195
},
197196
SecurityContext: &corev1.PodSecurityContext{
198-
RunAsNonRoot: pointer.Bool(false),
199197
SeccompProfile: &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault},
200198
},
201199
},

tests/utils/webapp.go

-2
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,12 @@ func DefaultWebapp(namespace string, name string, rootCASecretName string, tlsSe
7171
},
7272
},
7373
SecurityContext: &corev1.SecurityContext{
74-
RunAsNonRoot: pointer.Bool(false),
7574
AllowPrivilegeEscalation: pointer.Bool(false),
7675
SeccompProfile: &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault},
7776
},
7877
},
7978
},
8079
SecurityContext: &corev1.PodSecurityContext{
81-
RunAsNonRoot: pointer.Bool(false),
8280
SeccompProfile: &corev1.SeccompProfile{Type: corev1.SeccompProfileTypeRuntimeDefault},
8381
},
8482
},

0 commit comments

Comments
 (0)