make admin obd deadline configurable (#3154)

This commit is contained in:
Sidhartha Mani
2020-04-14 13:12:06 -07:00
committed by GitHub
parent dfa1e42b25
commit 9e4e435c56
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -43,6 +43,12 @@ var adminOBDFlags = []cli.Flag{
EnvVar: "MC_OBD_DATA",
Hidden: true,
},
cli.DurationFlag{
Name: "deadline",
Usage: "maximum duration that OBD tests should be allowed to run",
Value: 3600 * time.Second,
EnvVar: "MC_OBD_DEADLINE",
},
}
var adminOBDCmd = cli.Command{
@@ -253,7 +259,7 @@ func mainAdminOBD(ctx *cli.Context) error {
}
// Fetch info of all servers (cluster or single server)
obdChan := client.ServerOBDInfo(cont, options)
obdChan := client.ServerOBDInfo(cont, options, ctx.Duration("deadline"))
for adminOBDInfo := range obdChan {
if adminOBDInfo.Error != "" {
clusterOBDInfo.Status = "Error"
+1 -1
View File
@@ -16,7 +16,7 @@ require (
github.com/mattn/go-isatty v0.0.8
github.com/mattn/go-runewidth v0.0.5 // indirect
github.com/minio/cli v1.22.0
github.com/minio/minio v0.0.0-20200410044517-3184205519cb
github.com/minio/minio v0.0.0-20200414184832-ec11e99667e9
github.com/minio/minio-go/v6 v6.0.52
github.com/minio/sha256-simd v0.1.1
github.com/mitchellh/go-homedir v1.1.0