mainAdminUserRemove is the handle for "mc admin user remove" command.
(ctx *cli.Context)
| 56 | |
| 57 | // mainAdminUserRemove is the handle for "mc admin user remove" command. |
| 58 | func mainAdminUserRemove(ctx *cli.Context) error { |
| 59 | checkAdminUserRemoveSyntax(ctx) |
| 60 | |
| 61 | console.SetColor("UserMessage", color.New(color.FgGreen)) |
| 62 | |
| 63 | // Get the alias parameter from cli |
| 64 | args := ctx.Args() |
| 65 | aliasedURL := args.Get(0) |
| 66 | |
| 67 | // Create a new MinIO Admin Client |
| 68 | client, err := newAdminClient(aliasedURL) |
| 69 | fatalIf(err, "Unable to initialize admin connection.") |
| 70 | |
| 71 | e := client.RemoveUser(globalContext, args.Get(1)) |
| 72 | fatalIf(probe.NewError(e).Trace(args...), "Unable to remove %s", args.Get(1)) |
| 73 | |
| 74 | printMsg(userMessage{ |
| 75 | op: ctx.Command.Name, |
| 76 | AccessKey: args.Get(1), |
| 77 | }) |
| 78 | |
| 79 | return nil |
| 80 | } |
nothing calls this directly
no test coverage detected