From 3853a0ecd942d460a5eb602b4f932415f977a92f Mon Sep 17 00:00:00 2001 From: John Schnake Date: Thu, 2 May 2019 10:20:49 -0500 Subject: [PATCH] GKE also requires SAR endpoints There was a specific error flow that was commented as only applying to GKE. This was never tested specifically for GKE (only commented as such) but that seems to be out of date and can be removed. If the SAR endpoint does not exist it should be considered an error. --- test/e2e/framework/auth/BUILD | 1 - test/e2e/framework/auth/helpers.go | 10 ---------- 2 files changed, 11 deletions(-) diff --git a/test/e2e/framework/auth/BUILD b/test/e2e/framework/auth/BUILD index f459c20f3eba..c1bbba2fa05d 100644 --- a/test/e2e/framework/auth/BUILD +++ b/test/e2e/framework/auth/BUILD @@ -8,7 +8,6 @@ go_library( deps = [ "//staging/src/k8s.io/api/authorization/v1beta1:go_default_library", "//staging/src/k8s.io/api/rbac/v1beta1:go_default_library", - "//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/wait:go_default_library", diff --git a/test/e2e/framework/auth/helpers.go b/test/e2e/framework/auth/helpers.go index 5b3c9ac8d29f..39161a733582 100644 --- a/test/e2e/framework/auth/helpers.go +++ b/test/e2e/framework/auth/helpers.go @@ -25,7 +25,6 @@ import ( "github.com/pkg/errors" authorizationv1beta1 "k8s.io/api/authorization/v1beta1" rbacv1beta1 "k8s.io/api/rbac/v1beta1" - apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/wait" @@ -68,15 +67,6 @@ func WaitForNamedAuthorizationUpdate(c v1beta1authorization.SubjectAccessReviews err := wait.Poll(policyCachePollInterval, policyCachePollTimeout, func() (bool, error) { response, err := c.SubjectAccessReviews().Create(review) - // GKE doesn't enable the SAR endpoint. Without this endpoint, we cannot determine if the policy engine - // has adjusted as expected. In this case, simply wait one second and hope it's up to date - // TODO: Should have a check for the provider here but that introduces too tight of - // coupling with the `framework` package. See: https://github.com/kubernetes/kubernetes/issues/76726 - if apierrors.IsNotFound(err) { - logf("SubjectAccessReview endpoint is missing") - time.Sleep(1 * time.Second) - return true, nil - } if err != nil { return false, err }