@@ -24,7 +24,6 @@ import (
24
24
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
25
25
"k8s.io/apimachinery/pkg/labels"
26
26
clientset "k8s.io/client-go/kubernetes"
27
- "k8s.io/kubernetes/pkg/security/apparmor"
28
27
"k8s.io/kubernetes/test/e2e/framework"
29
28
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
30
29
imageutils "k8s.io/kubernetes/test/utils/image"
@@ -37,6 +36,14 @@ const (
37
36
38
37
loaderLabelKey = "name"
39
38
loaderLabelValue = "e2e-apparmor-loader"
39
+
40
+ // TODO: import this from the k8s.io/api once it's moved there (ref: https://github.com/kubernetes/kubernetes/pull/89198)
41
+ // Unconfined profile
42
+ profileNameUnconfined = "unconfined"
43
+
44
+ // TODO: import this from the k8s.io/api once it's moved there (ref: https://github.com/kubernetes/kubernetes/pull/89198)
45
+ // The prefix to an annotation key specifying a container profile.
46
+ containerAnnotationKeyPrefix = "container.apparmor.security.beta.kubernetes.io/"
40
47
)
41
48
42
49
// LoadAppArmorProfiles creates apparmor-profiles ConfigMap and apparmor-loader ReplicationController.
@@ -64,7 +71,7 @@ elif [[ $(< /proc/self/attr/current) != "%[3]s" ]]; then
64
71
fi` , appArmorDeniedPath , appArmorAllowedPath , appArmorProfilePrefix + nsName )
65
72
66
73
if unconfined {
67
- profile = apparmor . ProfileNameUnconfined
74
+ profile = profileNameUnconfined
68
75
testCmd = `
69
76
if cat /proc/sysrq-trigger 2>&1 | grep 'Permission denied'; then
70
77
echo 'FAILURE: reading /proc/sysrq-trigger should be allowed'
@@ -98,7 +105,7 @@ done`, testCmd)
98
105
ObjectMeta : metav1.ObjectMeta {
99
106
GenerateName : "test-apparmor-" ,
100
107
Annotations : map [string ]string {
101
- apparmor . ContainerAnnotationKeyPrefix + "test" : profile ,
108
+ containerAnnotationKeyPrefix + "test" : profile ,
102
109
},
103
110
Labels : map [string ]string {
104
111
"test" : "apparmor" ,
0 commit comments