Skip to content

Commit 076d231

Browse files
author
OpenShift Bot
authoredMay 5, 2017
Merge pull request #14034 from ncdc/do-not-show-policy-rules-with-attribute-restrictions
Merged by openshift-bot
2 parents 009cbef + 58868b5 commit 076d231

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"
@@ -1273,26 +1272,17 @@ func DescribePolicy(policy *authorizationapi.Policy) (string, error) {
12731272
})
12741273
}
12751274

1276-
const PolicyRuleHeadings = "Verbs\tNon-Resource URLs\tExtension\tResource Names\tAPI Groups\tResources"
1275+
const PolicyRuleHeadings = "Verbs\tNon-Resource URLs\tResource Names\tAPI Groups\tResources"
12771276

12781277
func DescribePolicyRule(out *tabwriter.Writer, rule authorizationapi.PolicyRule, indent string) {
1279-
extensionString := ""
12801278
if rule.AttributeRestrictions != nil {
1281-
extensionString = fmt.Sprintf("%#v", rule.AttributeRestrictions)
1282-
1283-
buffer := new(bytes.Buffer)
1284-
1285-
// TODO(rebase-1.6): we probably need a non-nil encoder and decoder
1286-
printer := NewHumanReadablePrinter(nil, nil, kprinters.PrintOptions{NoHeaders: true})
1287-
if err := printer.PrintObj(rule.AttributeRestrictions, buffer); err == nil {
1288-
extensionString = strings.TrimSpace(buffer.String())
1289-
}
1279+
// We are not supporting attribute restrictions going forward
1280+
return
12901281
}
12911282

1292-
fmt.Fprintf(out, indent+"%v\t%v\t%v\t%v\t%v\t%v\n",
1283+
fmt.Fprintf(out, indent+"%v\t%v\t%v\t%v\t%v\n",
12931284
rule.Verbs.List(),
12941285
rule.NonResourceURLs.List(),
1295-
extensionString,
12961286
rule.ResourceNames.List(),
12971287
rule.APIGroups,
12981288
rule.Resources.List(),

0 commit comments

Comments
 (0)
Please sign in to comment.