Skip to content

Commit 58868b5

Browse files
committed
Don't show policy rules with attribute restrictions
They're not supported any more.
1 parent d97afdf commit 58868b5

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

pkg/cmd/cli/describe/describer.go

+4-14
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package describe
22

33
import (
4-
"bytes"
54
"fmt"
65
"path/filepath"
76
"sort"
@@ -1247,26 +1246,17 @@ func DescribePolicy(policy *authorizationapi.Policy) (string, error) {
12471246
})
12481247
}
12491248

1250-
const PolicyRuleHeadings = "Verbs\tNon-Resource URLs\tExtension\tResource Names\tAPI Groups\tResources"
1249+
const PolicyRuleHeadings = "Verbs\tNon-Resource URLs\tResource Names\tAPI Groups\tResources"
12511250

12521251
func DescribePolicyRule(out *tabwriter.Writer, rule authorizationapi.PolicyRule, indent string) {
1253-
extensionString := ""
12541252
if rule.AttributeRestrictions != nil {
1255-
extensionString = fmt.Sprintf("%#v", rule.AttributeRestrictions)
1256-
1257-
buffer := new(bytes.Buffer)
1258-
1259-
// TODO(rebase-1.6): we probably need a non-nil encoder and decoder
1260-
printer := NewHumanReadablePrinter(nil, nil, kprinters.PrintOptions{NoHeaders: true})
1261-
if err := printer.PrintObj(rule.AttributeRestrictions, buffer); err == nil {
1262-
extensionString = strings.TrimSpace(buffer.String())
1263-
}
1253+
// We are not supporting attribute restrictions going forward
1254+
return
12641255
}
12651256

1266-
fmt.Fprintf(out, indent+"%v\t%v\t%v\t%v\t%v\t%v\n",
1257+
fmt.Fprintf(out, indent+"%v\t%v\t%v\t%v\t%v\n",
12671258
rule.Verbs.List(),
12681259
rule.NonResourceURLs.List(),
1269-
extensionString,
12701260
rule.ResourceNames.List(),
12711261
rule.APIGroups,
12721262
rule.Resources.List(),

0 commit comments

Comments
 (0)