Merge pull request #108654 from Shubham82/note-serviceaccount_flag_for_multiple-times

Improvement: Updated the serviceaccount flag for multiple subjects.

Kubernetes-commit: 8a437e171c42a0567e63419e2ae91a2196440aee
This commit is contained in:
Kubernetes Publisher 2022-05-03 18:23:47 -07:00
commit 48050594b0
4 changed files with 14 additions and 14 deletions

8
go.mod
View File

@ -31,10 +31,10 @@ require (
github.com/stretchr/testify v1.7.0
golang.org/x/sys v0.0.0-20220209214540-3681064d5158
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.0.0-20220413163940-7a897301bd56
k8s.io/api v0.0.0-20220504022944-af4f75e1994c
k8s.io/apimachinery v0.0.0-20220406001655-080c0c77fab5
k8s.io/cli-runtime v0.0.0-20220504025609-ddf455f66463
k8s.io/client-go v0.0.0-20220413164420-28ccde769fc5
k8s.io/client-go v0.0.0-20220504023308-2cf1a8ffd6db
k8s.io/component-base v0.0.0-20220331212037-3b9b201c27aa
k8s.io/component-helpers v0.0.0-20220330052013-855d491da0b6
k8s.io/klog/v2 v2.60.1
@ -48,10 +48,10 @@ require (
)
replace (
k8s.io/api => k8s.io/api v0.0.0-20220413163940-7a897301bd56
k8s.io/api => k8s.io/api v0.0.0-20220504022944-af4f75e1994c
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20220406001655-080c0c77fab5
k8s.io/cli-runtime => k8s.io/cli-runtime v0.0.0-20220504025609-ddf455f66463
k8s.io/client-go => k8s.io/client-go v0.0.0-20220413164420-28ccde769fc5
k8s.io/client-go => k8s.io/client-go v0.0.0-20220504023308-2cf1a8ffd6db
k8s.io/code-generator => k8s.io/code-generator v0.0.0-20220330050606-8f17de063761
k8s.io/component-base => k8s.io/component-base v0.0.0-20220331212037-3b9b201c27aa
k8s.io/component-helpers => k8s.io/component-helpers v0.0.0-20220330052013-855d491da0b6

8
go.sum
View File

@ -878,14 +878,14 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.0.0-20220413163940-7a897301bd56 h1:kCg7nKtlLw11+FZqIc2ceS/j2guTgA4jW6Yuq9+TV14=
k8s.io/api v0.0.0-20220413163940-7a897301bd56/go.mod h1:jimmvAe8QfauNx6CM87E20mTsK3CPgiOzVhfaNASkJc=
k8s.io/api v0.0.0-20220504022944-af4f75e1994c h1:4chKbSSvIxpT/ls7NTHZyE0xnKewL0HSbdaYyesfrmQ=
k8s.io/api v0.0.0-20220504022944-af4f75e1994c/go.mod h1:jimmvAe8QfauNx6CM87E20mTsK3CPgiOzVhfaNASkJc=
k8s.io/apimachinery v0.0.0-20220406001655-080c0c77fab5 h1:nG9Zc74nUlkVHMapMJVjlH8hT3z/fBVixlVfrsQgi24=
k8s.io/apimachinery v0.0.0-20220406001655-080c0c77fab5/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM=
k8s.io/cli-runtime v0.0.0-20220504025609-ddf455f66463 h1:Ici2x2ahD3k0wJrSae1tKf+EcRyRLqCVE8A5UtOvHjo=
k8s.io/cli-runtime v0.0.0-20220504025609-ddf455f66463/go.mod h1:QPB7YO7HzmeJ2395hCEgbQFW3niSRHB9AXZpY2EFzAo=
k8s.io/client-go v0.0.0-20220413164420-28ccde769fc5 h1:rWJnUu0XjscMYcqmyM49Nsu7w1pJ7PoFbFZZAbCw1AI=
k8s.io/client-go v0.0.0-20220413164420-28ccde769fc5/go.mod h1:2AylUVFyWxiRcOPb3uDGc47Y2p3RhD+aFQBxpkNXB74=
k8s.io/client-go v0.0.0-20220504023308-2cf1a8ffd6db h1:aXmNBd0tI9tm/FSO/qvvW+lyICneJG6ca2i/8qLz1w8=
k8s.io/client-go v0.0.0-20220504023308-2cf1a8ffd6db/go.mod h1:KJemYjNFgrswAbSygu5ZHEKc0dcSAqtdDT+4yUrlbmU=
k8s.io/code-generator v0.0.0-20220330050606-8f17de063761/go.mod h1:dpVhs00hTuTdTY6jvVxvTFCk6gSMrtfRydbhZwHI15w=
k8s.io/component-base v0.0.0-20220331212037-3b9b201c27aa h1:HXrw3PNPz5LUdx4tWHrhjcRadLTrUmerZmNc4MRYuOg=
k8s.io/component-base v0.0.0-20220331212037-3b9b201c27aa/go.mod h1:3bhERi0RMmLibjhzQTaOenaiYbqZrwtoCRd58dbFtDk=

View File

@ -101,9 +101,9 @@ func NewCmdCreateClusterRoleBinding(f cmdutil.Factory, ioStreams genericclioptio
cmdutil.AddDryRunFlag(cmd)
cmd.Flags().StringVar(&o.ClusterRole, "clusterrole", "", i18n.T("ClusterRole this ClusterRoleBinding should reference"))
cmd.MarkFlagRequired("clusterrole")
cmd.Flags().StringArrayVar(&o.Users, "user", o.Users, "Usernames to bind to the clusterrole")
cmd.Flags().StringArrayVar(&o.Groups, "group", o.Groups, "Groups to bind to the clusterrole")
cmd.Flags().StringArrayVar(&o.ServiceAccounts, "serviceaccount", o.ServiceAccounts, "Service accounts to bind to the clusterrole, in the format <namespace>:<name>")
cmd.Flags().StringArrayVar(&o.Users, "user", o.Users, "Usernames to bind to the clusterrole. The flag can be repeated to add multiple users.")
cmd.Flags().StringArrayVar(&o.Groups, "group", o.Groups, "Groups to bind to the clusterrole. The flag can be repeated to add multiple groups.")
cmd.Flags().StringArrayVar(&o.ServiceAccounts, "serviceaccount", o.ServiceAccounts, "Service accounts to bind to the clusterrole, in the format <namespace>:<name>. The flag can be repeated to add multiple service accounts.")
cmdutil.AddFieldManagerFlagVar(cmd, &o.FieldManager, "kubectl-create")
// Completion for relevant flags

View File

@ -104,9 +104,9 @@ func NewCmdCreateRoleBinding(f cmdutil.Factory, ioStreams genericclioptions.IOSt
cmdutil.AddDryRunFlag(cmd)
cmd.Flags().StringVar(&o.ClusterRole, "clusterrole", "", i18n.T("ClusterRole this RoleBinding should reference"))
cmd.Flags().StringVar(&o.Role, "role", "", i18n.T("Role this RoleBinding should reference"))
cmd.Flags().StringArrayVar(&o.Users, "user", o.Users, "Usernames to bind to the role")
cmd.Flags().StringArrayVar(&o.Groups, "group", o.Groups, "Groups to bind to the role")
cmd.Flags().StringArrayVar(&o.ServiceAccounts, "serviceaccount", o.ServiceAccounts, "Service accounts to bind to the role, in the format <namespace>:<name>")
cmd.Flags().StringArrayVar(&o.Users, "user", o.Users, "Usernames to bind to the role. The flag can be repeated to add multiple users.")
cmd.Flags().StringArrayVar(&o.Groups, "group", o.Groups, "Groups to bind to the role. The flag can be repeated to add multiple groups.")
cmd.Flags().StringArrayVar(&o.ServiceAccounts, "serviceaccount", o.ServiceAccounts, "Service accounts to bind to the role, in the format <namespace>:<name>. The flag can be repeated to add multiple service accounts.")
cmdutil.AddFieldManagerFlagVar(cmd, &o.FieldManager, "kubectl-create")
return cmd
}