e2e: Remove special serviceaccount permission requirement

This commit is contained in:
Mikkel Oscar Lyderik Larsen
2017-04-02 10:15:41 +02:00
parent 4fa902a915
commit f39f2e29a2

View File

@@ -23,11 +23,8 @@ import (
"time" "time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apiserver/pkg/authentication/serviceaccount"
"k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/api/v1"
rbacv1beta1 "k8s.io/kubernetes/pkg/apis/rbac/v1beta1"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset" "k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
"k8s.io/kubernetes/test/e2e/framework" "k8s.io/kubernetes/test/e2e/framework"
@@ -177,18 +174,6 @@ func testPreStop(c clientset.Interface, ns string) {
var _ = framework.KubeDescribe("PreStop", func() { var _ = framework.KubeDescribe("PreStop", func() {
f := framework.NewDefaultFramework("prestop") f := framework.NewDefaultFramework("prestop")
BeforeEach(func() {
// this test wants extra permissions. Since the namespace names are unique, we can leave this
// lying around so we don't have to race any caches
framework.BindClusterRole(f.ClientSet.Rbac(), "cluster-admin", f.Namespace.Name,
rbacv1beta1.Subject{Kind: rbacv1beta1.ServiceAccountKind, Namespace: f.Namespace.Name, Name: "default"})
err := framework.WaitForAuthorizationUpdate(f.ClientSet.AuthorizationV1beta1(),
serviceaccount.MakeUsername(f.Namespace.Name, "default"),
"", "create", schema.GroupResource{Resource: "pods"}, true)
framework.ExpectNoError(err)
})
It("should call prestop when killing a pod [Conformance]", func() { It("should call prestop when killing a pod [Conformance]", func() {
testPreStop(f.ClientSet, f.Namespace.Name) testPreStop(f.ClientSet, f.Namespace.Name)
}) })