Skip to content

Commit a3d802c

Browse files
committed
test/framework: psp.go skipper.go remove direct import /k8s.io/kubernetes/pkg
1 parent 1a85614 commit a3d802c

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

test/e2e/framework/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ go_library(
3131
"//pkg/kubelet/apis/stats/v1alpha1:go_default_library",
3232
"//pkg/kubelet/events:go_default_library",
3333
"//pkg/kubelet/sysctl:go_default_library",
34-
"//pkg/security/podsecuritypolicy/seccomp:go_default_library",
3534
"//pkg/util/taints:go_default_library",
3635
"//staging/src/k8s.io/api/apps/v1:go_default_library",
3736
"//staging/src/k8s.io/api/core/v1:go_default_library",

test/e2e/framework/psp.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
"k8s.io/apimachinery/pkg/runtime/schema"
3030
"k8s.io/apiserver/pkg/authentication/serviceaccount"
3131
clientset "k8s.io/client-go/kubernetes"
32-
"k8s.io/kubernetes/pkg/security/podsecuritypolicy/seccomp"
3332

3433
"github.com/onsi/ginkgo"
3534

@@ -39,6 +38,12 @@ import (
3938

4039
const (
4140
podSecurityPolicyPrivileged = "e2e-test-privileged-psp"
41+
42+
// allowAny is the wildcard used to allow any profile.
43+
allowAny = "*"
44+
45+
// allowedProfilesAnnotationKey specifies the allowed seccomp profiles.
46+
allowedProfilesAnnotationKey = "seccomp.security.alpha.kubernetes.io/allowedProfileNames"
4247
)
4348

4449
var (
@@ -52,7 +57,7 @@ func privilegedPSP(name string) *policyv1beta1.PodSecurityPolicy {
5257
return &policyv1beta1.PodSecurityPolicy{
5358
ObjectMeta: metav1.ObjectMeta{
5459
Name: name,
55-
Annotations: map[string]string{seccomp.AllowedProfilesAnnotationKey: seccomp.AllowAny},
60+
Annotations: map[string]string{allowedProfilesAnnotationKey: allowAny},
5661
},
5762
Spec: policyv1beta1.PodSecurityPolicySpec{
5863
Privileged: true,

test/e2e/framework/skipper/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ go_library(
66
importpath = "k8s.io/kubernetes/test/e2e/framework/skipper",
77
visibility = ["//visibility:public"],
88
deps = [
9-
"//pkg/features:go_default_library",
109
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
1110
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
1211
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
@@ -15,6 +14,7 @@ go_library(
1514
"//staging/src/k8s.io/client-go/discovery:go_default_library",
1615
"//staging/src/k8s.io/client-go/dynamic:go_default_library",
1716
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
17+
"//staging/src/k8s.io/component-base/featuregate:go_default_library",
1818
"//test/e2e/framework:go_default_library",
1919
"//test/e2e/framework/node:go_default_library",
2020
"//test/e2e/framework/ssh:go_default_library",

test/e2e/framework/skipper/skipper.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import (
3636
"k8s.io/client-go/discovery"
3737
"k8s.io/client-go/dynamic"
3838
clientset "k8s.io/client-go/kubernetes"
39-
"k8s.io/kubernetes/pkg/features"
39+
"k8s.io/component-base/featuregate"
4040
"k8s.io/kubernetes/test/e2e/framework"
4141
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
4242
e2essh "k8s.io/kubernetes/test/e2e/framework/ssh"
@@ -45,6 +45,9 @@ import (
4545
// TestContext should be used by all tests to access common context data.
4646
var TestContext framework.TestContextType
4747

48+
// New local storage types to support local storage capacity isolation
49+
var localStorageCapacityIsolation featuregate.Feature = "LocalStorageCapacityIsolation"
50+
4851
func skipInternalf(caller int, format string, args ...interface{}) {
4952
msg := fmt.Sprintf(format, args...)
5053
framework.Logf(msg)
@@ -131,8 +134,8 @@ func SkipUnlessAtLeast(value int, minValue int, message string) {
131134

132135
// SkipUnlessLocalEphemeralStorageEnabled skips if the LocalStorageCapacityIsolation is not enabled.
133136
func SkipUnlessLocalEphemeralStorageEnabled() {
134-
if !utilfeature.DefaultFeatureGate.Enabled(features.LocalStorageCapacityIsolation) {
135-
skipInternalf(1, "Only supported when %v feature is enabled", features.LocalStorageCapacityIsolation)
137+
if !utilfeature.DefaultFeatureGate.Enabled(localStorageCapacityIsolation) {
138+
skipInternalf(1, "Only supported when %v feature is enabled", localStorageCapacityIsolation)
136139
}
137140
}
138141

0 commit comments

Comments
 (0)