Skip to content

Commit

Permalink
Merge pull request #6291 from blackpiglet/make_e2e_workload_obey_rest…
Browse files Browse the repository at this point in the history
…ricted_psa_1

Add file system group setting for deployment and pod used in E2E test.
  • Loading branch information
danfengliu authored May 20, 2023
2 parents 40d6130 + 98baaa9 commit c34880e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/e2e/util/k8s/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/util/k8s/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c34880e

Please sign in to comment.