mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-11-03 07:11:01 +00:00
Refactor of e2e/framework/authorizer_util.go
- moves these helper functions into e2e/framework/auth - removes logging from helper functions - in some cases explicitly returns errors that were implicitly ignored/logged. In the situations where they should be ignored, we explicitly check that the condition is met before ignoring it. - fixes references of these methods to use the right package and return values
This commit is contained in:
@@ -30,6 +30,7 @@ import (
|
||||
podutil "k8s.io/kubernetes/pkg/api/v1/pod"
|
||||
commonutils "k8s.io/kubernetes/test/e2e/common"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
"k8s.io/kubernetes/test/e2e/framework/auth"
|
||||
"k8s.io/kubernetes/test/e2e/framework/testfiles"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
@@ -51,10 +52,11 @@ var _ = framework.KubeDescribe("[Feature:Example]", func() {
|
||||
|
||||
// this test wants powerful permissions. Since the namespace names are unique, we can leave this
|
||||
// lying around so we don't have to race any caches
|
||||
framework.BindClusterRoleInNamespace(c.RbacV1beta1(), "edit", f.Namespace.Name,
|
||||
err := auth.BindClusterRoleInNamespace(c.RbacV1beta1(), "edit", f.Namespace.Name,
|
||||
rbacv1beta1.Subject{Kind: rbacv1beta1.ServiceAccountKind, Namespace: f.Namespace.Name, Name: "default"})
|
||||
framework.ExpectNoError(err)
|
||||
|
||||
err := framework.WaitForAuthorizationUpdate(c.AuthorizationV1beta1(),
|
||||
err = auth.WaitForAuthorizationUpdate(c.AuthorizationV1beta1(),
|
||||
serviceaccount.MakeUsername(f.Namespace.Name, "default"),
|
||||
f.Namespace.Name, "create", schema.GroupResource{Resource: "pods"}, true)
|
||||
framework.ExpectNoError(err)
|
||||
|
||||
Reference in New Issue
Block a user