From 89dbf781d67ec2e9d1ae1381dc0b875764ba8560 Mon Sep 17 00:00:00 2001 From: Slava Semushin Date: Wed, 16 Nov 2016 19:22:40 +0100 Subject: [PATCH] actions -> verbs --- pkg/cmd/admin/policy/create.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/cmd/admin/policy/create.go b/pkg/cmd/admin/policy/create.go index f0301dce3d91..97ed542bb3e6 100644 --- a/pkg/cmd/admin/policy/create.go +++ b/pkg/cmd/admin/policy/create.go @@ -26,7 +26,7 @@ type NewClusterRoleOptions struct { Name string Resources []string - Actions []string + Verbs []string } // NewCmdCreateClusterRole implements the OpenShift cli create-cluster-role command. @@ -34,9 +34,9 @@ func NewCmdCreateClusterRole(name, fullName string, f *clientcmd.Factory, out io options := &NewClusterRoleOptions{} cmd := &cobra.Command{ - Use: name + " ", // TODO + Use: name + " ", Short: "Create a new cluster role", - Long: `Create a new cluster role for specified resources and actions`, // TODO + Long: `Create a new cluster role for specified resources and verbs`, Example: fmt.Sprintf(createClusterRoleExample, fullName), Run: func(cmd *cobra.Command, args []string) { if err := options.Complete(f, args); err != nil { @@ -48,7 +48,7 @@ func NewCmdCreateClusterRole(name, fullName string, f *clientcmd.Factory, out io } cmd.Flags().StringSliceVarP(&options.Resources, "resources", "", options.Resources, "list of resources (separated by comma)") - cmd.Flags().StringSliceVarP(&options.Actions, "actions", "", options.Actions, "list of actions (separated by comma)") + cmd.Flags().StringSliceVarP(&options.Verbs, "verbs", "", options.Verbs, "list of verbs (separated by comma)") return cmd } @@ -77,14 +77,14 @@ func (o *NewClusterRoleOptions) Validate() error { if len(o.Resources) == 0 { return errors.New("Resources is required") } - if len(o.Actions) == 0 { - return errors.New("Actions is required") + if len(o.Verbs) == 0 { + return errors.New("Verbs is required") } return nil } func (o *NewClusterRoleOptions) CreateRole() error { - rule, err := authapi.NewRule(o.Actions...).Resources(o.Resources...).Groups("").Rule() + rule, err := authapi.NewRule(o.Verbs...).Resources(o.Resources...).Groups("").Rule() if err != nil { return err }