mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-02-22 07:03:28 +00:00
test/e2e_node: Update procMount test to use Restricted PSA level
Update the procMount test expectations to match the intentional PSA
policy relaxation introduced in commit e8bd3f629d.
As of Kubernetes 1.35+, Pod Security Admission Baseline policy
allows UnmaskedProcMount for pods with user namespaces (hostUsers:
false). This was an intentional change to support nested container
use cases while maintaining security through user namespace isolation.
The test "will fail to unmask proc mounts if not privileged" was
written before this relaxation and expected Baseline level to reject
UnmaskedProcMount. Since Baseline now allows it (for user namespace
pods), the test needs to use Restricted level instead, which
unconditionally blocks UnmaskedProcMount regardless of user namespace
settings.
Changes:
- Change PSA level from Baseline to Restricted
- Update test name to clarify it's testing Restricted level behavior
- Update framework name from "proc-mount-baseline-test" to
"proc-mount-restricted-test"
Fixes the ci-crio-userns-e2e-serial test failure that started occurring
when runtimes began reporting user namespace support.
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
This commit is contained in:
@@ -46,10 +46,10 @@ var _ = SIGDescribe("DefaultProcMount [LinuxOnly]", framework.WithNodeConformanc
|
||||
})
|
||||
|
||||
var _ = SIGDescribe("ProcMount [LinuxOnly]", feature.ProcMountType, feature.UserNamespacesSupport, func() {
|
||||
f := framework.NewDefaultFramework("proc-mount-baseline-test")
|
||||
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
|
||||
f := framework.NewDefaultFramework("proc-mount-restricted-test")
|
||||
f.NamespacePodSecurityLevel = admissionapi.LevelRestricted
|
||||
|
||||
f.It("will fail to unmask proc mounts if not privileged", func(ctx context.Context) {
|
||||
f.It("will fail to unmask proc mounts at restricted level", func(ctx context.Context) {
|
||||
if !supportsUserNS(ctx, f) {
|
||||
e2eskipper.Skipf("runtime does not support user namespaces")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user