Consider prefix in health check

This commit is contained in:
Lorenz Brun 2019-01-15 21:22:07 +01:00
parent 19b2758919
commit df3033a240

View File

@ -19,6 +19,7 @@ package factory
import ( import (
"context" "context"
"fmt" "fmt"
"path"
"sync" "sync"
"sync/atomic" "sync/atomic"
"time" "time"
@ -73,7 +74,7 @@ func newETCD3HealthCheck(c storagebackend.Config) (func() error, error) {
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel() defer cancel()
// See https://github.com/etcd-io/etcd/blob/master/etcdctl/ctlv3/command/ep_command.go#L118 // See https://github.com/etcd-io/etcd/blob/master/etcdctl/ctlv3/command/ep_command.go#L118
_, err := client.Get(ctx, "health") _, err := client.Get(ctx, path.Join(c.Prefix, "health"))
if err == nil { if err == nil {
return nil return nil
} }