Skip to content

Commit

Permalink
Merge pull request kubernetes#39165 from deads2k/fed-18-tolerate-miss…
Browse files Browse the repository at this point in the history
…ingsar

tolerate missing subjectaccessreview in e2e
  • Loading branch information
eparis authored Dec 22, 2016
2 parents 89a506a + 2444e0f commit 9ef610b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/e2e/framework/authorizer_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package framework
import (
"time"

apierrors "k8s.io/kubernetes/pkg/api/errors"
authorizationv1beta1 "k8s.io/kubernetes/pkg/apis/authorization/v1beta1"
v1beta1authorization "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/authorization/v1beta1"
"k8s.io/kubernetes/pkg/runtime/schema"
Expand Down Expand Up @@ -46,6 +47,12 @@ func WaitForAuthorizationUpdate(c v1beta1authorization.SubjectAccessReviewsGette
}
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
if apierrors.IsNotFound(err) {
time.Sleep(1 * time.Second)
return true, nil
}
if err != nil {
return false, err
}
Expand Down

0 comments on commit 9ef610b

Please sign in to comment.