@@ -146,33 +146,29 @@ var _ = SIGDescribe("Security Context", func() {
146
146
testPodSELinuxLabeling (f , false , true )
147
147
})
148
148
149
- ginkgo .It ("should support seccomp alpha unconfined annotation on the container [Feature:Seccomp] [LinuxOnly]" , func () {
150
- // TODO: port to SecurityContext as soon as seccomp is out of alpha
149
+ ginkgo .It ("should support seccomp unconfined on the container [LinuxOnly]" , func () {
151
150
pod := scTestPod (false , false )
152
- pod .Annotations [ v1 . SeccompContainerAnnotationKeyPrefix + "test-container" ] = "unconfined"
153
- pod .Annotations [ v1 . SeccompPodAnnotationKey ] = v1 .SeccompProfileRuntimeDefault
151
+ pod .Spec . Containers [ 0 ]. SecurityContext = & v1. SecurityContext { SeccompProfile : & v1. SeccompProfile { Type : v1 . SeccompProfileTypeUnconfined }}
152
+ pod .Spec . SecurityContext = & v1.PodSecurityContext { SeccompProfile : & v1. SeccompProfile { Type : v1 . SeccompProfileTypeRuntimeDefault }}
154
153
pod .Spec .Containers [0 ].Command = []string {"grep" , "ecc" , "/proc/self/status" }
155
154
f .TestContainerOutput (v1 .SeccompPodAnnotationKey , pod , 0 , []string {"0" }) // seccomp disabled
156
155
})
157
156
158
- ginkgo .It ("should support seccomp alpha unconfined annotation on the pod [Feature:Seccomp] [LinuxOnly]" , func () {
159
- // TODO: port to SecurityContext as soon as seccomp is out of alpha
157
+ ginkgo .It ("should support seccomp unconfined on the pod [LinuxOnly]" , func () {
160
158
pod := scTestPod (false , false )
161
- pod .Annotations [ v1 . SeccompPodAnnotationKey ] = "unconfined"
159
+ pod .Spec . SecurityContext = & v1. PodSecurityContext { SeccompProfile : & v1. SeccompProfile { Type : v1 . SeccompProfileTypeUnconfined }}
162
160
pod .Spec .Containers [0 ].Command = []string {"grep" , "ecc" , "/proc/self/status" }
163
161
f .TestContainerOutput (v1 .SeccompPodAnnotationKey , pod , 0 , []string {"0" }) // seccomp disabled
164
162
})
165
163
166
- ginkgo .It ("should support seccomp alpha runtime/default annotation [Feature:Seccomp] [LinuxOnly]" , func () {
167
- // TODO: port to SecurityContext as soon as seccomp is out of alpha
164
+ ginkgo .It ("should support seccomp runtime/default [LinuxOnly]" , func () {
168
165
pod := scTestPod (false , false )
169
- pod .Annotations [ v1 . SeccompContainerAnnotationKeyPrefix + "test-container" ] = v1 .SeccompProfileRuntimeDefault
166
+ pod .Spec . Containers [ 0 ]. SecurityContext = & v1.SecurityContext { SeccompProfile : & v1. SeccompProfile { Type : v1 . SeccompProfileTypeRuntimeDefault }}
170
167
pod .Spec .Containers [0 ].Command = []string {"grep" , "ecc" , "/proc/self/status" }
171
168
f .TestContainerOutput (v1 .SeccompPodAnnotationKey , pod , 0 , []string {"2" }) // seccomp filtered
172
169
})
173
170
174
- ginkgo .It ("should support seccomp default which is unconfined [Feature:Seccomp] [LinuxOnly]" , func () {
175
- // TODO: port to SecurityContext as soon as seccomp is out of alpha
171
+ ginkgo .It ("should support seccomp default which is unconfined [LinuxOnly]" , func () {
176
172
pod := scTestPod (false , false )
177
173
pod .Spec .Containers [0 ].Command = []string {"grep" , "ecc" , "/proc/self/status" }
178
174
f .TestContainerOutput (v1 .SeccompPodAnnotationKey , pod , 0 , []string {"0" }) // seccomp disabled
0 commit comments