Skip to content

Commit d9908b4

Browse files
authored
Update skopeo pod for psa (#2844)
Signed-off-by: perdasilva <[email protected]>
1 parent 69fe294 commit d9908b4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/e2e/skopeo.go

+15
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"os/exec"
77

88
"github.com/operator-framework/operator-lifecycle-manager/pkg/lib/operatorclient"
9+
"k8s.io/utils/pointer"
910

1011
corev1 "k8s.io/api/core/v1"
1112
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -81,11 +82,25 @@ func createSkopeoPod(client operatorclient.ClientInterface, args []string, names
8182
Labels: map[string]string{"name": skopeo},
8283
},
8384
Spec: corev1.PodSpec{
85+
SecurityContext: &corev1.PodSecurityContext{
86+
SeccompProfile: &corev1.SeccompProfile{
87+
Type: corev1.SeccompProfileTypeRuntimeDefault,
88+
},
89+
},
8490
Containers: []corev1.Container{
8591
{
8692
Name: skopeo,
8793
Image: skopeoImage,
8894
Args: args,
95+
SecurityContext: &corev1.SecurityContext{
96+
ReadOnlyRootFilesystem: pointer.Bool(false),
97+
AllowPrivilegeEscalation: pointer.Bool(false),
98+
Capabilities: &corev1.Capabilities{
99+
Drop: []corev1.Capability{"ALL"},
100+
},
101+
RunAsNonRoot: pointer.Bool(true),
102+
RunAsUser: pointer.Int64(1001),
103+
},
89104
},
90105
},
91106
RestartPolicy: corev1.RestartPolicyNever,

0 commit comments

Comments
 (0)