Skip to content

Commit 1130e89

Browse files
authored
Merge pull request kubernetes#89198 from tanjunchen/cleanup20200318
e2e/framework: security/ and /service remove direct import /k8s.io/kubernetes/pkg/
2 parents a8217d3 + 6003ff4 commit 1130e89

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

test/e2e/framework/security/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ go_library(
66
importpath = "k8s.io/kubernetes/test/e2e/framework/security",
77
visibility = ["//visibility:public"],
88
deps = [
9-
"//pkg/security/apparmor:go_default_library",
109
"//staging/src/k8s.io/api/core/v1:go_default_library",
1110
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
1211
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",

test/e2e/framework/security/apparmor.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2525
"k8s.io/apimachinery/pkg/labels"
2626
clientset "k8s.io/client-go/kubernetes"
27-
"k8s.io/kubernetes/pkg/security/apparmor"
2827
"k8s.io/kubernetes/test/e2e/framework"
2928
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
3029
imageutils "k8s.io/kubernetes/test/utils/image"
@@ -37,6 +36,14 @@ const (
3736

3837
loaderLabelKey = "name"
3938
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/"
4047
)
4148

4249
// LoadAppArmorProfiles creates apparmor-profiles ConfigMap and apparmor-loader ReplicationController.
@@ -64,7 +71,7 @@ elif [[ $(< /proc/self/attr/current) != "%[3]s" ]]; then
6471
fi`, appArmorDeniedPath, appArmorAllowedPath, appArmorProfilePrefix+nsName)
6572

6673
if unconfined {
67-
profile = apparmor.ProfileNameUnconfined
74+
profile = profileNameUnconfined
6875
testCmd = `
6976
if cat /proc/sysrq-trigger 2>&1 | grep 'Permission denied'; then
7077
echo 'FAILURE: reading /proc/sysrq-trigger should be allowed'
@@ -98,7 +105,7 @@ done`, testCmd)
98105
ObjectMeta: metav1.ObjectMeta{
99106
GenerateName: "test-apparmor-",
100107
Annotations: map[string]string{
101-
apparmor.ContainerAnnotationKeyPrefix + "test": profile,
108+
containerAnnotationKeyPrefix + "test": profile,
102109
},
103110
Labels: map[string]string{
104111
"test": "apparmor",

0 commit comments

Comments
 (0)