Support completions for --clusterrole of kubectl create clusterrolebinding

pull/6/head
Kazuki Suda 2017-06-29 22:12:28 +09:00
parent 49ed2a3115
commit 1b4da8f66a
2 changed files with 6 additions and 0 deletions

View File

@ -130,6 +130,11 @@ __kubectl_get_resource_node()
__kubectl_parse_get "node"
}
__kubectl_get_resource_clusterrole()
{
__kubectl_parse_get "clusterrole"
}
# $1 is the name of the pod we want to get the list of containers inside
__kubectl_get_containers()
{

View File

@ -53,6 +53,7 @@ func NewCmdCreateClusterRoleBinding(f cmdutil.Factory, cmdOut io.Writer) *cobra.
cmdutil.AddPrinterFlags(cmd)
cmdutil.AddGeneratorFlags(cmd, cmdutil.ClusterRoleBindingV1GeneratorName)
cmd.Flags().String("clusterrole", "", i18n.T("ClusterRole this ClusterRoleBinding should reference"))
cmd.MarkFlagCustom("clusterrole", "__kubectl_get_resource_clusterrole")
cmd.Flags().StringArray("user", []string{}, "Usernames to bind to the role")
cmd.Flags().StringArray("group", []string{}, "Groups to bind to the role")
cmd.Flags().StringArray("serviceaccount", []string{}, "Service accounts to bind to the role, in the format <namespace>:<name>")