From 16d4fb7e52c54b7de684a6da59fe98af9c1ae001 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Mon, 11 Dec 2017 09:53:27 -0500 Subject: [PATCH] Display apiGroups before resources in PolicyRule --- pkg/apis/rbac/helpers.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/apis/rbac/helpers.go b/pkg/apis/rbac/helpers.go index 4b1a1d3a0c7..373711500b1 100644 --- a/pkg/apis/rbac/helpers.go +++ b/pkg/apis/rbac/helpers.go @@ -147,6 +147,10 @@ func (r PolicyRule) String() string { func (r PolicyRule) CompactString() string { formatStringParts := []string{} formatArgs := []interface{}{} + if len(r.APIGroups) > 0 { + formatStringParts = append(formatStringParts, "APIGroups:%q") + formatArgs = append(formatArgs, r.APIGroups) + } if len(r.Resources) > 0 { formatStringParts = append(formatStringParts, "Resources:%q") formatArgs = append(formatArgs, r.Resources) @@ -159,10 +163,6 @@ func (r PolicyRule) CompactString() string { formatStringParts = append(formatStringParts, "ResourceNames:%q") 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 { formatStringParts = append(formatStringParts, "Verbs:%q") formatArgs = append(formatArgs, r.Verbs)