Skip to content

Commit

Permalink
Merge pull request #66837 from deads2k/client-02-panic
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue (batch tested with PRs 66870, 66929, 66837). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix panic fake SAR client expansion

if the object is nil, the type assertion fails.

@kubernetes/sig-api-machinery-bugs 

```release-note
NONE
```
  • Loading branch information
Kubernetes Submit Queue committed Aug 3, 2018
2 parents 99f9651 + 13db7c7 commit a2223e9
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -23,5 +23,8 @@ import (

func (c *FakeSubjectAccessReviews) Create(sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) {
obj, err := c.Fake.Invokes(core.NewRootCreateAction(authorizationapi.SchemeGroupVersion.WithResource("subjectaccessreviews"), sar), &authorizationapi.SubjectAccessReview{})
if obj == nil {
return nil, err
}
return obj.(*authorizationapi.SubjectAccessReview), err
}

0 comments on commit a2223e9

Please sign in to comment.