Skip to content

Commit

Permalink
BUG: Fixing CLI Parser small bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
safaci2000 committed Oct 25, 2023
1 parent e84ad8d commit f748ad4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/tools/auth_service_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func newListServiceAccountCmd() simplecobra.Commander {
NameP: "list",
Short: description,
Long: description,
CommandsList: []simplecobra.Commander{newTokensCmd()},
CommandsList: []simplecobra.Commander{},
RunFunc: func(ctx context.Context, cd *simplecobra.Commandeer, rootCmd *support.RootCommand, args []string) error {
rootCmd.TableObj.AppendHeader(table.Row{"id", "service name", "role", "tokens", "token id", "token name", "expiration"})
apiKeys := rootCmd.GrafanaSvc().ListServiceAccounts()
Expand Down Expand Up @@ -83,7 +83,7 @@ func newDeleteServiceAccountTokensCmd() simplecobra.Commander {
NameP: "clearTokens",
Short: description,
Long: description,
CommandsList: []simplecobra.Commander{newTokensCmd()},
CommandsList: []simplecobra.Commander{},
RunFunc: func(ctx context.Context, cd *simplecobra.Commandeer, rootCmd *support.RootCommand, args []string) error {
if len(args) < 1 {
return errors.New("requires a service account ID to be specified")
Expand Down Expand Up @@ -116,7 +116,7 @@ func newDeleteServiceAccountCmd() simplecobra.Commander {
NameP: "clear",
Short: description,
Long: description,
CommandsList: []simplecobra.Commander{newTokensCmd()},
CommandsList: []simplecobra.Commander{},
RunFunc: func(ctx context.Context, cd *simplecobra.Commandeer, rootCmd *support.RootCommand, args []string) error {
savedFiles := rootCmd.GrafanaSvc().DeleteAllServiceAccounts()
log.Infof("Delete Service Accounts for context: '%s'", config.Config().AppConfig.GetContext())
Expand All @@ -140,7 +140,7 @@ func newServiceAccount() simplecobra.Commander {
NameP: "newService",
Short: description,
Long: description,
CommandsList: []simplecobra.Commander{newTokensCmd()},
CommandsList: []simplecobra.Commander{},
RunFunc: func(ctx context.Context, cd *simplecobra.Commandeer, rootCmd *support.RootCommand, args []string) error {
if len(args) < 2 {
return errors.New("requires a key name and a role('admin','viewer','editor') [ttl optional] ")
Expand Down

0 comments on commit f748ad4

Please sign in to comment.