diff --git a/etcd/scheduler/scheduler.go b/etcd/scheduler/scheduler.go index 944b4a68..7ac7ff83 100644 --- a/etcd/scheduler/scheduler.go +++ b/etcd/scheduler/scheduler.go @@ -28,7 +28,6 @@ import ( etcd "github.com/coreos/etcd/clientv3" "github.com/coreos/etcd/clientv3/concurrency" - pb "github.com/coreos/etcd/etcdserver/etcdserverpb" errwrap "github.com/pkg/errors" ) @@ -88,11 +87,6 @@ func (obj *Result) Shutdown() { // XXX: should we have a waitgroup to wait for it all to close? } -// TODO: use: https://github.com/coreos/etcd/pull/8488 when available -func leaseValue(key string) etcd.Cmp { - return etcd.Cmp{Key: []byte(key), Target: pb.Compare_LEASE} -} - // Schedule returns a scheduler result which can be queried with it's available // methods. This automatically causes different etcd clients sharing the same // path to discover each other and be part of the scheduled set. On close the @@ -181,7 +175,7 @@ func Schedule(client *etcd.Client, path string, hostname string, opts ...Option) data := "TODO" // XXX: no data to exchange alongside hostnames yet ifops := []etcd.Cmp{ etcd.Compare(etcd.Value(exchangePathHost), "=", data), - etcd.Compare(leaseValue(exchangePathHost), "=", int64(leaseID)), // XXX: remove int64() after 3.3.0 + etcd.Compare(etcd.LeaseValue(exchangePathHost), "=", leaseID), } elsop := etcd.OpPut(exchangePathHost, data, etcd.WithLease(leaseID))