mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-13 13:55:41 +00:00
Display apiGroups before resources in PolicyRule
This commit is contained in:
parent
bb72237375
commit
16d4fb7e52
@ -147,6 +147,10 @@ func (r PolicyRule) String() string {
|
|||||||
func (r PolicyRule) CompactString() string {
|
func (r PolicyRule) CompactString() string {
|
||||||
formatStringParts := []string{}
|
formatStringParts := []string{}
|
||||||
formatArgs := []interface{}{}
|
formatArgs := []interface{}{}
|
||||||
|
if len(r.APIGroups) > 0 {
|
||||||
|
formatStringParts = append(formatStringParts, "APIGroups:%q")
|
||||||
|
formatArgs = append(formatArgs, r.APIGroups)
|
||||||
|
}
|
||||||
if len(r.Resources) > 0 {
|
if len(r.Resources) > 0 {
|
||||||
formatStringParts = append(formatStringParts, "Resources:%q")
|
formatStringParts = append(formatStringParts, "Resources:%q")
|
||||||
formatArgs = append(formatArgs, r.Resources)
|
formatArgs = append(formatArgs, r.Resources)
|
||||||
@ -159,10 +163,6 @@ func (r PolicyRule) CompactString() string {
|
|||||||
formatStringParts = append(formatStringParts, "ResourceNames:%q")
|
formatStringParts = append(formatStringParts, "ResourceNames:%q")
|
||||||
formatArgs = append(formatArgs, r.ResourceNames)
|
formatArgs = append(formatArgs, r.ResourceNames)
|
||||||
}
|
}
|
||||||
if len(r.APIGroups) > 0 {
|
|
||||||
formatStringParts = append(formatStringParts, "APIGroups:%q")
|
|
||||||
formatArgs = append(formatArgs, r.APIGroups)
|
|
||||||
}
|
|
||||||
if len(r.Verbs) > 0 {
|
if len(r.Verbs) > 0 {
|
||||||
formatStringParts = append(formatStringParts, "Verbs:%q")
|
formatStringParts = append(formatStringParts, "Verbs:%q")
|
||||||
formatArgs = append(formatArgs, r.Verbs)
|
formatArgs = append(formatArgs, r.Verbs)
|
||||||
|
Loading…
Reference in New Issue
Block a user