mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Make scheduling e2e tests run PSa-restricted pods
The "pause" pods that are being run in the scheduling tests are sometimes launched in system namespaces. Therefore even if a test is considered to be running on a "baseline" Pod Security admission level, its "baseline" pods would fail to run if the global PSa enforcement policy is set to "restricted" - the system namespaces have no PSa labels. The "pause" pods run by this test can actually easily run with "restricted" security context, and so this patch turns them into just that.
This commit is contained in:
parent
303f47c0c0
commit
682ee2908a
@ -828,15 +828,17 @@ func initPausePod(f *framework.Framework, conf pausePodConfig) *v1.Pod {
|
||||
OwnerReferences: conf.OwnerReferences,
|
||||
},
|
||||
Spec: v1.PodSpec{
|
||||
SecurityContext: e2epod.GetRestrictedPodSecurityContext(),
|
||||
NodeSelector: conf.NodeSelector,
|
||||
Affinity: conf.Affinity,
|
||||
TopologySpreadConstraints: conf.TopologySpreadConstraints,
|
||||
RuntimeClassName: conf.RuntimeClassHandler,
|
||||
Containers: []v1.Container{
|
||||
{
|
||||
Name: conf.Name,
|
||||
Image: imageutils.GetPauseImageName(),
|
||||
Ports: conf.Ports,
|
||||
Name: conf.Name,
|
||||
Image: imageutils.GetPauseImageName(),
|
||||
Ports: conf.Ports,
|
||||
SecurityContext: e2epod.GetRestrictedContainerSecurityContext(),
|
||||
},
|
||||
},
|
||||
Tolerations: conf.Tolerations,
|
||||
|
Loading…
Reference in New Issue
Block a user