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:
Shireesh Anjal
2021-11-09 16:36:02 -08:00
committed by GitHub
parent a776222b33
commit 1461b652d9
3 changed files with 7 additions and 18 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ var adminCmdSubcommands = []cli.Command{
adminConsoleCmd,
adminPrometheusCmd,
adminKMSCmd,
adminHealthCmd,
adminHealthCmd(),
adminSubnetCmd,
adminBucketCmd,
adminTierCmd,
+2 -2
View File
@@ -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
View File
@@ -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
}