removed invalid state (#2173)

This commit is contained in:
tgruben 2022-08-01 12:47:17 -05:00 committed by GitHub
parent 0300cb071f
commit 177db2e2b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -482,10 +482,12 @@ func (e *Etcd) Leader() *disco.Peer {
}
func (e *Etcd) ClusterState(ctx context.Context) (out disco.ClusterState, err error) {
if e.e == nil {
return disco.ClusterStateUnknown, nil
if len(e.options.EtcdHosts) == 0 {
// only valid if not in external etcd mode
if e.e == nil {
return disco.ClusterStateUnknown, nil
}
}
var (
heartbeats int = 0
starting bool