Merge pull request #6291 from blackpiglet/make_e2e_workload_obey_restricted_psa_1

Add file system group setting for deployment and pod used in E2E test.
This commit is contained in:
danfengliu
2023-05-20 09:40:27 +08:00
committed by GitHub
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -93,6 +93,10 @@ func NewDeployment(name, ns string, replicas int32, labels map[string]string, co
Labels: labels,
},
Spec: v1.PodSpec{
SecurityContext: &v1.PodSecurityContext{
FSGroup: func(i int64) *int64 { return &i }(65534),
FSGroupChangePolicy: func(policy v1.PodFSGroupChangePolicy) *v1.PodFSGroupChangePolicy { return &policy }(v1.FSGroupChangeAlways),
},
Containers: containers,
},
},
+4
View File
@@ -70,6 +70,10 @@ func CreatePod(client TestClient, ns, name, sc, pvcName string, volumeNameList [
Annotations: ann,
},
Spec: corev1.PodSpec{
SecurityContext: &v1.PodSecurityContext{
FSGroup: func(i int64) *int64 { return &i }(65534),
FSGroupChangePolicy: func(policy v1.PodFSGroupChangePolicy) *v1.PodFSGroupChangePolicy { return &policy }(v1.FSGroupChangeAlways),
},
Containers: []corev1.Container{
{
Name: name,