mirror of https://github.com/k3s-io/k3s
Support completions for --clusterrole of kubectl create clusterrolebinding
parent
49ed2a3115
commit
1b4da8f66a
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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>")
|
||||
|
|
Loading…
Reference in New Issue