func waitForNamedAuthorizationUpdate(t *testing.T, c v1authorization.SubjectAccessReviewsGetter, user, namespace, verb, resourceName string, resource schema.GroupResource, allowed bool) {
	review := &authorizationv1.SubjectAccessReview{
		Spec: authorizationv1.SubjectAccessReviewSpec{
			ResourceAttributes: &authorizationv1.ResourceAttributes{
				Group:     resource.Group,
				Verb:      verb,
				Resource:  resource.Resource,
				Namespace: namespace,
				Name:      resourceName,
			},
			User: user,
		},
	}

	if err := wait.Poll(time.Millisecond*100, time.Second*5, func() (bool, error) {
		response, err := c.SubjectAccessReviews().Create(context.TODO(), review, metav1.CreateOptions{})
		if err != nil {
			return false, err
		}
		if response.Status.Allowed != allowed {
			return false, nil
		}
		return true, nil
	}); err != nil {
		t.Fatal(err)
	}
}
// waitForNamedAuthorizationUpdate checks if the given user can perform the named verb and action on the named resource.
// Copied from k8s.io/kubernetes/test/e2e/framework/auth.
waitForNamedAuthorizationUpdate checks if the given user can perform the named verb and action on the named resource.
Copied from k8s.io/kubernetes/test/e2e/framework/auth.
// waitForNamedAuthorizationUpdate checks if the given user can perform the named verb and action on the named resource . // Copied from k8s . io / kubernetes / test / e2e / framework / auth .
func waitForNamedAuthorizationUpdate(t *testing.T, c v1authorization.SubjectAccessReviewsGetter, user, namespace, verb, resourceName string, resource schema.GroupResource, allowed bool) {
	review := &authorizationv1.SubjectAccessReview{
		Spec: authorizationv1.SubjectAccessReviewSpec{
			ResourceAttributes: &authorizationv1.ResourceAttributes{
				Group:     resource.Group,
				Verb:      verb,
				Resource:  resource.Resource,
				Namespace: namespace,
				Name:      resourceName,
			},
			User: user,
		},
	}
	if err := wait.Poll(time.Millisecond*100, time.Second*5, func() (bool, error) {
		response, err := c.SubjectAccessReviews().Create(context.TODO(), review, metav1.CreateOptions{})
		if err != nil {
			return false, err
		}
		if response.Status.Allowed != allowed {
			return false, nil
		}
		return true, nil
	}); err != nil {
		t.Fatal(err)
	}
}
func waitForNamedAuthorizationUpdate ( t * testing . T , c v1authorization . SubjectAccessReviewsGetter , user , namespace , verb , resourceName string , resource schema . GroupResource , allowed bool ) { review := & authorizationv1 . SubjectAccessReview { Spec : authorizationv1 . SubjectAccessReviewSpec { ResourceAttributes : & authorizationv1 . ResourceAttributes { Group : resource . Group , Verb : verb , Resource : resource . Resource , Namespace : namespace , Name : resourceName , } , User : user , } , } if err := wait . Poll ( time . Millisecond * 100 , time . Second * 5 , func ( ) ( bool , error ) { response , err := c . SubjectAccessReviews ( ) . Create ( context . TODO ( ) , review , metav1 . CreateOptions { } ) if err != nil { return false , err } if response . Status . Allowed != allowed { return false , nil } return true , nil } ) ; err != nil { t . Fatal ( err ) } }
waitForNamedAuthorizationUpdate checks if the given user can perform the named verb and action on the named resource.
waitForNamedAuthorizationUpdate checks if the given user can perform the named verb and action on the named resource .