Skip to content

Commit 69fe294

Browse files
authored
Update magic catalog for psa changes (#2842)
Signed-off-by: perdasilva <perdasilva@redhat.com>
1 parent e08415d commit 69fe294

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

test/e2e/magic_catalog.go

+13-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1212
utilerrors "k8s.io/apimachinery/pkg/util/errors"
1313
"k8s.io/apimachinery/pkg/util/intstr"
14+
"k8s.io/utils/pointer"
1415
k8scontrollerclient "sigs.k8s.io/controller-runtime/pkg/client"
1516
)
1617

@@ -259,15 +260,18 @@ func (c *MagicCatalog) makeCatalogSourcePod() *corev1.Pod {
259260
volumeMountName string = "fbc-catalog"
260261
)
261262

262-
readOnlyRootFilesystem := false
263-
264263
return &corev1.Pod{
265264
ObjectMeta: metav1.ObjectMeta{
266265
Name: c.podName,
267266
Namespace: c.namespace,
268267
Labels: c.makeCatalogSourcePodLabels(),
269268
},
270269
Spec: corev1.PodSpec{
270+
SecurityContext: &corev1.PodSecurityContext{
271+
SeccompProfile: &corev1.SeccompProfile{
272+
Type: corev1.SeccompProfileTypeRuntimeDefault,
273+
},
274+
},
271275
Containers: []corev1.Container{
272276
{
273277
Name: "catalog",
@@ -304,7 +308,13 @@ func (c *MagicCatalog) makeCatalogSourcePod() *corev1.Pod {
304308
},
305309
},
306310
SecurityContext: &corev1.SecurityContext{
307-
ReadOnlyRootFilesystem: &readOnlyRootFilesystem,
311+
ReadOnlyRootFilesystem: pointer.Bool(false),
312+
AllowPrivilegeEscalation: pointer.Bool(false),
313+
Capabilities: &corev1.Capabilities{
314+
Drop: []corev1.Capability{"ALL"},
315+
},
316+
RunAsNonRoot: pointer.Bool(true),
317+
RunAsUser: pointer.Int64(1001),
308318
},
309319
ImagePullPolicy: corev1.PullAlways,
310320
TerminationMessagePolicy: corev1.TerminationMessageFallbackToLogsOnError,

0 commit comments

Comments
 (0)