mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #39684 from deads2k/rbac-37-subresource-message
Automatic merge from submit-queue (batch tested with PRs 39684, 39577, 38989, 39534, 39702) add subresource to forbidden message Fixes https://github.com/kubernetes/kubernetes/issues/39640 The message will now be `user "username" cannot verb resource.group/subresource in the the namespace "ns"`.
This commit is contained in:
commit
49b900a45e
@ -56,6 +56,9 @@ func forbiddenMessage(attributes authorizer.Attributes) string {
|
||||
if group := attributes.GetAPIGroup(); len(group) > 0 {
|
||||
resource = resource + "." + group
|
||||
}
|
||||
if subresource := attributes.GetSubresource(); len(subresource) > 0 {
|
||||
resource = resource + "/" + subresource
|
||||
}
|
||||
|
||||
if ns := attributes.GetNamespace(); len(ns) > 0 {
|
||||
return fmt.Sprintf("User %q cannot %s %s in the namespace %q.", username, attributes.GetVerb(), resource, ns)
|
||||
|
Loading…
Reference in New Issue
Block a user