Files
kubernetes/pkg
Kubernetes Submit Queue 38882c3727 Merge pull request #37537 from xilabao/extend-err-info-when-authorize-failed
Automatic merge from submit-queue

extend err info when authorize failed

if rolebinding related to a non-existent role,  kubectl get po will return a error.

old result:
```shell
$ kubectl --token=/test get po
Error from server (InternalError): an error on the server ("Internal Server Error: \"/api/v1/namespaces/default/pods\"") has prevented the request from succeeding (get pods)
```
new result (output the reason):
```shell
$ kubectl --token=hi/test get po
Error from server (Forbidden): User "hi" cannot list pods in the namespace "default".: "role.rbac.authorization.k8s.io \"admin-resource-role\" not found" (get pods)
```

test.yaml
```
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1alpha1
metadata:
  name:  admin-resource-binding
  namespace: default
subjects:
  - kind: Group
    name: test
roleRef:
  kind: Role
  name: admin-resource-role
```
2016-12-22 06:10:37 -08:00
..
2016-12-15 14:20:26 -08:00
2016-12-12 13:30:07 -08:00
2016-12-19 16:05:48 -08:00
2016-12-12 13:30:07 -08:00
2016-12-14 12:39:48 -08:00
2016-12-12 13:30:07 -08:00
2016-12-12 13:30:07 -08:00
2016-12-12 13:30:07 -08:00
2016-12-12 13:30:07 -08:00
2016-12-21 09:03:27 -05:00
2016-12-14 12:39:49 -08:00
2016-12-12 13:30:07 -08:00
2016-12-19 23:13:14 +01:00
2016-12-14 12:39:48 -08:00
2016-12-12 13:30:07 -08:00
2016-12-14 12:39:48 -08:00
2016-12-12 13:30:07 -08:00
2016-12-12 13:30:07 -08:00
2016-12-12 13:30:07 -08:00
2016-12-12 13:30:07 -08:00
2016-12-12 13:30:07 -08:00
2016-12-12 13:30:07 -08:00
2016-12-12 13:30:07 -08:00