Merge pull request #66837 from deads2k/client-02-panic

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
```
This commit is contained in:
Kubernetes Submit Queue 2018-08-02 17:03:08 -07:00 committed by GitHub
commit a2223e9a92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}