Introduce admin health command (#3847)
It will be a hidden command and will behave exactly same as `mc admin subnet health` Also, remove the deprecated command `admin subnet obd`
This commit is contained in:
+1
-1
@@ -47,7 +47,7 @@ var adminCmdSubcommands = []cli.Command{
|
||||
adminConsoleCmd,
|
||||
adminPrometheusCmd,
|
||||
adminKMSCmd,
|
||||
adminHealthCmd,
|
||||
adminHealthCmd(),
|
||||
adminSubnetCmd,
|
||||
adminBucketCmd,
|
||||
adminTierCmd,
|
||||
|
||||
@@ -78,7 +78,7 @@ var adminSubnetHealthCmd = cli.Command{
|
||||
Name: "health",
|
||||
Usage: "run health check for SUBNET",
|
||||
OnUsageError: onUsageError,
|
||||
Action: mainAdminHealth,
|
||||
Action: mainSubnetHealth,
|
||||
Before: setGlobalsFromContext,
|
||||
Flags: append(adminHealthFlags, globalFlags...),
|
||||
CustomHelpTemplate: `NAME:
|
||||
@@ -164,7 +164,7 @@ func warnText(s string) string {
|
||||
return console.Colorize("WARN", s)
|
||||
}
|
||||
|
||||
func mainAdminHealth(ctx *cli.Context) error {
|
||||
func mainSubnetHealth(ctx *cli.Context) error {
|
||||
checkAdminHealthSyntax(ctx)
|
||||
|
||||
// Get the alias parameter from cli
|
||||
|
||||
+4
-15
@@ -18,7 +18,6 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/fatih/color"
|
||||
"github.com/minio/cli"
|
||||
)
|
||||
|
||||
@@ -44,18 +43,8 @@ func mainAdminSubnet(ctx *cli.Context) error {
|
||||
// Sub-commands like "health", "register" have their own main.
|
||||
}
|
||||
|
||||
// Deprecated - to be removed in a future release
|
||||
// mainAdminSubnet is the handle for "mc admin subnet" command.
|
||||
func mainAdminOBD(ctx *cli.Context) error {
|
||||
color.Yellow("Deprecated - please use 'mc admin subnet health'")
|
||||
return nil
|
||||
}
|
||||
|
||||
var adminHealthCmd = cli.Command{
|
||||
Name: "health",
|
||||
Aliases: []string{"obd"},
|
||||
Usage: "Deprecated - please use 'mc admin subnet health'",
|
||||
Action: mainAdminOBD,
|
||||
CustomHelpTemplate: `{{.Usage}}`,
|
||||
Hidden: true,
|
||||
func adminHealthCmd() cli.Command {
|
||||
cmd := adminSubnetHealthCmd
|
||||
cmd.Hidden = true
|
||||
return cmd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user