etcd: Bump to new 3.4.x version
This moves to the newest etcd release, and also updates the imports to the new go.etcd.io path. I think this is a bit of a pain, but might as well get it done.
This commit is contained in:
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -1,5 +1,5 @@
|
||||
[submodule "vendor/github.com/coreos/etcd"]
|
||||
path = vendor/github.com/coreos/etcd
|
||||
path = vendor/go.etcd.io/etcd
|
||||
url = https://github.com/coreos/etcd/
|
||||
[submodule "vendor/google.golang.org/grpc"]
|
||||
path = vendor/google.golang.org/grpc
|
||||
|
||||
@@ -26,8 +26,8 @@ import (
|
||||
"github.com/purpleidea/mgmt/util"
|
||||
"github.com/purpleidea/mgmt/util/errwrap"
|
||||
|
||||
etcd "github.com/coreos/etcd/clientv3" // "clientv3"
|
||||
pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
|
||||
etcd "go.etcd.io/etcd/clientv3" // "clientv3"
|
||||
pb "go.etcd.io/etcd/etcdserver/etcdserverpb"
|
||||
)
|
||||
|
||||
// nominateApply applies the changed watcher data onto our local caches.
|
||||
@@ -192,7 +192,7 @@ func (obj *EmbdEtcd) nominateCb(ctx context.Context) error {
|
||||
// an "event" for member add since there is not any event that's
|
||||
// currently built-in to etcd and (3) so we have a key to expire
|
||||
// when we shutdown or crash to give us the member remove event.
|
||||
// please see issue: https://github.com/coreos/etcd/issues/5277
|
||||
// please see issue: https://github.com/etcd-io/etcd/issues/5277
|
||||
|
||||
} else if obj.serverAction(serverActionStop) { // stop?
|
||||
// server is running, but it should not be
|
||||
@@ -200,7 +200,7 @@ func (obj *EmbdEtcd) nominateCb(ctx context.Context) error {
|
||||
// i have been un-nominated, remove self and shutdown server!
|
||||
// we don't need to do a member remove if i'm the last one...
|
||||
if len(obj.nominated) != 0 { // don't call if nobody left but me!
|
||||
// work around: https://github.com/coreos/etcd/issues/5482
|
||||
// work around: https://github.com/etcd-io/etcd/issues/5482
|
||||
// and it might make sense to avoid it if we're the last
|
||||
obj.Logf("member remove: removing self: %d", obj.serverID)
|
||||
resp, err := obj.memberRemove(ctx, obj.serverID)
|
||||
@@ -243,7 +243,7 @@ func (obj *EmbdEtcd) nominateCb(ctx context.Context) error {
|
||||
// volunteer entry we must respond by removing the nomination so that it can
|
||||
// receive that message and shutdown.
|
||||
// FIXME: we might need to respond to member change/disconnect/shutdown events,
|
||||
// see: https://github.com/coreos/etcd/issues/5277
|
||||
// see: https://github.com/etcd-io/etcd/issues/5277
|
||||
// XXX: Don't allow this function to partially run if it is canceled part way
|
||||
// through... We don't want an inconsistent state where we did unnominate, but
|
||||
// didn't remove a member...
|
||||
@@ -301,7 +301,7 @@ func (obj *EmbdEtcd) volunteerCb(ctx context.Context) error {
|
||||
|
||||
// NOTE: There used to be an is_leader check right here...
|
||||
// FIXME: Should we use WithRequireLeader instead? Here? Elsewhere?
|
||||
// https://godoc.org/github.com/coreos/etcd/clientv3#WithRequireLeader
|
||||
// https://godoc.org/github.com/etcd-io/etcd/clientv3#WithRequireLeader
|
||||
|
||||
// FIXME: can this happen, and if so, is it an error or a pass-through?
|
||||
if len(obj.volunteers) == 0 {
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
|
||||
"github.com/purpleidea/mgmt/etcd/interfaces"
|
||||
|
||||
etcdtypes "github.com/coreos/etcd/pkg/types"
|
||||
etcdtypes "go.etcd.io/etcd/pkg/types"
|
||||
)
|
||||
|
||||
// Data represents the input data that is passed to the chooser.
|
||||
|
||||
@@ -25,8 +25,8 @@ import (
|
||||
|
||||
"github.com/purpleidea/mgmt/etcd/interfaces"
|
||||
|
||||
etcd "github.com/coreos/etcd/clientv3"
|
||||
etcdtypes "github.com/coreos/etcd/pkg/types"
|
||||
etcd "go.etcd.io/etcd/clientv3"
|
||||
etcdtypes "go.etcd.io/etcd/pkg/types"
|
||||
)
|
||||
|
||||
// XXX: Test causing cluster shutdowns with:
|
||||
|
||||
@@ -27,7 +27,7 @@ import (
|
||||
"github.com/purpleidea/mgmt/etcd/interfaces"
|
||||
"github.com/purpleidea/mgmt/util"
|
||||
|
||||
etcd "github.com/coreos/etcd/clientv3"
|
||||
etcd "go.etcd.io/etcd/clientv3"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -26,8 +26,8 @@ import (
|
||||
"github.com/purpleidea/mgmt/etcd/interfaces"
|
||||
"github.com/purpleidea/mgmt/util/errwrap"
|
||||
|
||||
etcd "github.com/coreos/etcd/clientv3" // "clientv3"
|
||||
"github.com/coreos/etcd/clientv3/namespace"
|
||||
etcd "go.etcd.io/etcd/clientv3" // "clientv3"
|
||||
"go.etcd.io/etcd/clientv3/namespace"
|
||||
)
|
||||
|
||||
// method represents the method we used to build the simple client.
|
||||
@@ -301,7 +301,7 @@ func (obj *Simple) Get(ctx context.Context, path string, opts ...etcd.OpOption)
|
||||
return nil, fmt.Errorf("empty response")
|
||||
}
|
||||
|
||||
// TODO: write a resp.ToMap() function on https://godoc.org/github.com/coreos/etcd/etcdserver/etcdserverpb#RangeResponse
|
||||
// TODO: write a resp.ToMap() function on https://godoc.org/github.com/etcd-io/etcd/etcdserver/etcdserverpb#RangeResponse
|
||||
result := make(map[string]string)
|
||||
for _, x := range resp.Kvs {
|
||||
result[string(x.Key)] = string(x.Value)
|
||||
@@ -387,8 +387,8 @@ func (obj *Simple) ComplexWatcher(ctx context.Context, path string, opts ...etcd
|
||||
wg := &sync.WaitGroup{}
|
||||
|
||||
// TODO: if we can detect the use of WithCreatedNotify, we don't need to
|
||||
// hard-code it down below... https://github.com/coreos/etcd/issues/9689
|
||||
// XXX: proof of concept patch: https://github.com/coreos/etcd/pull/9705
|
||||
// hard-code it down below... https://github.com/etcd-io/etcd/issues/9689
|
||||
// XXX: proof of concept patch: https://github.com/etcd-io/etcd/pull/9705
|
||||
//for _, op := range opts {
|
||||
// //if op.Cmp(etcd.WithCreatedNotify()) == nil { // would be best
|
||||
// if etcd.OpOptionCmp(op, etcd.WithCreatedNotify()) == nil {
|
||||
|
||||
@@ -24,8 +24,8 @@ import (
|
||||
"github.com/purpleidea/mgmt/etcd/interfaces"
|
||||
"github.com/purpleidea/mgmt/util/errwrap"
|
||||
|
||||
etcd "github.com/coreos/etcd/clientv3"
|
||||
etcdutil "github.com/coreos/etcd/clientv3/clientv3util"
|
||||
etcd "go.etcd.io/etcd/clientv3"
|
||||
etcdutil "go.etcd.io/etcd/clientv3/clientv3util"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -26,8 +26,8 @@ import (
|
||||
"github.com/purpleidea/mgmt/util"
|
||||
"github.com/purpleidea/mgmt/util/errwrap"
|
||||
|
||||
etcd "github.com/coreos/etcd/clientv3"
|
||||
etcdutil "github.com/coreos/etcd/clientv3/clientv3util"
|
||||
etcd "go.etcd.io/etcd/clientv3"
|
||||
etcdutil "go.etcd.io/etcd/clientv3/clientv3util"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
|
||||
"github.com/purpleidea/mgmt/util/errwrap"
|
||||
|
||||
etcd "github.com/coreos/etcd/clientv3"
|
||||
etcd "go.etcd.io/etcd/clientv3"
|
||||
)
|
||||
|
||||
// setHostnameConverged sets whether a specific hostname is converged.
|
||||
|
||||
@@ -27,8 +27,8 @@ import (
|
||||
"github.com/purpleidea/mgmt/etcd/interfaces"
|
||||
"github.com/purpleidea/mgmt/util/errwrap"
|
||||
|
||||
etcd "github.com/coreos/etcd/clientv3"
|
||||
etcdutil "github.com/coreos/etcd/clientv3/clientv3util"
|
||||
etcd "go.etcd.io/etcd/clientv3"
|
||||
etcdutil "go.etcd.io/etcd/clientv3/clientv3util"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
10
etcd/etcd.go
10
etcd/etcd.go
@@ -122,11 +122,11 @@ import (
|
||||
"github.com/purpleidea/mgmt/util"
|
||||
"github.com/purpleidea/mgmt/util/errwrap"
|
||||
|
||||
etcd "github.com/coreos/etcd/clientv3" // "clientv3"
|
||||
"github.com/coreos/etcd/clientv3/concurrency"
|
||||
"github.com/coreos/etcd/clientv3/namespace"
|
||||
"github.com/coreos/etcd/embed"
|
||||
etcdtypes "github.com/coreos/etcd/pkg/types"
|
||||
etcd "go.etcd.io/etcd/clientv3" // "clientv3"
|
||||
"go.etcd.io/etcd/clientv3/concurrency"
|
||||
"go.etcd.io/etcd/clientv3/namespace"
|
||||
"go.etcd.io/etcd/embed"
|
||||
etcdtypes "go.etcd.io/etcd/pkg/types"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -30,8 +30,8 @@ import (
|
||||
|
||||
"github.com/purpleidea/mgmt/util/errwrap"
|
||||
|
||||
etcd "github.com/coreos/etcd/clientv3" // "clientv3"
|
||||
etcdutil "github.com/coreos/etcd/clientv3/clientv3util"
|
||||
etcd "go.etcd.io/etcd/clientv3" // "clientv3"
|
||||
etcdutil "go.etcd.io/etcd/clientv3/clientv3util"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -37,9 +37,9 @@ import (
|
||||
"github.com/purpleidea/mgmt/etcd/interfaces"
|
||||
"github.com/purpleidea/mgmt/util/errwrap"
|
||||
|
||||
etcd "github.com/coreos/etcd/clientv3" // "clientv3"
|
||||
rpctypes "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
|
||||
"github.com/spf13/afero"
|
||||
etcd "go.etcd.io/etcd/clientv3" // "clientv3"
|
||||
rpctypes "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -27,10 +27,10 @@ import (
|
||||
"github.com/purpleidea/mgmt/util"
|
||||
"github.com/purpleidea/mgmt/util/errwrap"
|
||||
|
||||
etcd "github.com/coreos/etcd/clientv3"
|
||||
pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
|
||||
"github.com/coreos/etcd/mvcc/mvccpb"
|
||||
etcdtypes "github.com/coreos/etcd/pkg/types" // generated package
|
||||
etcd "go.etcd.io/etcd/clientv3"
|
||||
pb "go.etcd.io/etcd/etcdserver/etcdserverpb"
|
||||
"go.etcd.io/etcd/mvcc/mvccpb"
|
||||
etcdtypes "go.etcd.io/etcd/pkg/types" // generated package
|
||||
)
|
||||
|
||||
// setEndpoints sets the endpoints on the etcd client if it exists. It
|
||||
|
||||
@@ -20,8 +20,8 @@ package interfaces
|
||||
import (
|
||||
"context"
|
||||
|
||||
etcd "github.com/coreos/etcd/clientv3" // "clientv3"
|
||||
pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
|
||||
etcd "go.etcd.io/etcd/clientv3" // "clientv3"
|
||||
pb "go.etcd.io/etcd/etcdserver/etcdserverpb"
|
||||
)
|
||||
|
||||
// WatcherData is the structure of data passed to a callback from any watcher.
|
||||
|
||||
@@ -26,10 +26,10 @@ import (
|
||||
|
||||
"github.com/purpleidea/mgmt/util/errwrap"
|
||||
|
||||
etcd "github.com/coreos/etcd/clientv3"
|
||||
rpctypes "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
|
||||
pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
|
||||
etcdtypes "github.com/coreos/etcd/pkg/types"
|
||||
etcd "go.etcd.io/etcd/clientv3"
|
||||
rpctypes "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes"
|
||||
pb "go.etcd.io/etcd/etcdserver/etcdserverpb"
|
||||
etcdtypes "go.etcd.io/etcd/pkg/types"
|
||||
)
|
||||
|
||||
// addSelfState is used to populate the initial state when I am adding myself.
|
||||
@@ -161,7 +161,7 @@ func (obj *EmbdEtcd) memberRemove(ctx context.Context, memberID uint64) (*etcd.M
|
||||
// and doesn't watch events, it could miss changes if they happen rapidly. It
|
||||
// does not send results on the channel, since results could be captured in the
|
||||
// fn callback. It will send an error on the channel if something goes wrong.
|
||||
// TODO: https://github.com/coreos/etcd/issues/5277
|
||||
// TODO: https://github.com/etcd-io/etcd/issues/5277
|
||||
func (obj *EmbdEtcd) memberChange(ctx context.Context, fn func([]*pb.Member) error, d time.Duration) (chan error, error) {
|
||||
ch := make(chan error)
|
||||
go func() {
|
||||
|
||||
@@ -24,9 +24,9 @@ import (
|
||||
|
||||
"github.com/purpleidea/mgmt/util/errwrap"
|
||||
|
||||
etcd "github.com/coreos/etcd/clientv3"
|
||||
etcdutil "github.com/coreos/etcd/clientv3/clientv3util"
|
||||
etcdtypes "github.com/coreos/etcd/pkg/types"
|
||||
etcd "go.etcd.io/etcd/clientv3"
|
||||
etcdutil "go.etcd.io/etcd/clientv3/clientv3util"
|
||||
etcdtypes "go.etcd.io/etcd/pkg/types"
|
||||
)
|
||||
|
||||
// volunteer offers yourself up to be a server if needed. If you specify a nil
|
||||
|
||||
@@ -28,8 +28,8 @@ import (
|
||||
|
||||
"github.com/purpleidea/mgmt/util/errwrap"
|
||||
|
||||
etcd "github.com/coreos/etcd/clientv3"
|
||||
"github.com/coreos/etcd/clientv3/concurrency"
|
||||
etcd "go.etcd.io/etcd/clientv3"
|
||||
"go.etcd.io/etcd/clientv3/concurrency"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -27,8 +27,8 @@ import (
|
||||
"github.com/purpleidea/mgmt/util"
|
||||
"github.com/purpleidea/mgmt/util/errwrap"
|
||||
|
||||
"github.com/coreos/etcd/embed"
|
||||
etcdtypes "github.com/coreos/etcd/pkg/types"
|
||||
"go.etcd.io/etcd/embed"
|
||||
etcdtypes "go.etcd.io/etcd/pkg/types"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -143,7 +143,7 @@ func (obj *EmbdEtcd) runServer(newCluster bool, peerURLsMap etcdtypes.URLsMap) (
|
||||
cfg.LCUrls = obj.ClientURLs
|
||||
cfg.APUrls = aPUrls
|
||||
cfg.ACUrls = aCUrls
|
||||
cfg.StrictReconfigCheck = false // XXX: workaround https://github.com/coreos/etcd/issues/6305
|
||||
cfg.StrictReconfigCheck = false // XXX: workaround https://github.com/etcd-io/etcd/issues/6305
|
||||
cfg.MaxTxnOps = DefaultMaxTxnOps
|
||||
|
||||
cfg.InitialCluster = initialPeerURLsMap.String() // including myself!
|
||||
|
||||
@@ -26,7 +26,7 @@ import (
|
||||
|
||||
"github.com/purpleidea/mgmt/util/errwrap"
|
||||
|
||||
etcdtypes "github.com/coreos/etcd/pkg/types"
|
||||
etcdtypes "go.etcd.io/etcd/pkg/types"
|
||||
)
|
||||
|
||||
// copyURL copies a URL.
|
||||
|
||||
@@ -45,7 +45,7 @@ import (
|
||||
"github.com/purpleidea/mgmt/util"
|
||||
"github.com/purpleidea/mgmt/util/errwrap"
|
||||
|
||||
etcdtypes "github.com/coreos/etcd/pkg/types"
|
||||
etcdtypes "go.etcd.io/etcd/pkg/types"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
2
spec.in
2
spec.in
@@ -30,7 +30,7 @@ A next generation config management prototype!
|
||||
# FIXME: in the future, these could be vendor-ed in
|
||||
mkdir -p vendor/
|
||||
export GOPATH=`pwd`/vendor/
|
||||
go get github.com/coreos/etcd/client
|
||||
go get github.com/etcd-io/etcd/clientv3
|
||||
go get gopkg.in/yaml.v2
|
||||
go get gopkg.in/fsnotify.v1
|
||||
go get github.com/urfave/cli
|
||||
|
||||
1
vendor/github.com/coreos/etcd
generated
vendored
1
vendor/github.com/coreos/etcd
generated
vendored
Submodule vendor/github.com/coreos/etcd deleted from 98d3084268
2
vendor/github.com/grpc-ecosystem/go-grpc-prometheus
generated
vendored
2
vendor/github.com/grpc-ecosystem/go-grpc-prometheus
generated
vendored
Submodule vendor/github.com/grpc-ecosystem/go-grpc-prometheus updated: 0dafe0d496...c225b8c3b0
2
vendor/github.com/grpc-ecosystem/grpc-gateway
generated
vendored
2
vendor/github.com/grpc-ecosystem/grpc-gateway
generated
vendored
Submodule vendor/github.com/grpc-ecosystem/grpc-gateway updated: 8cc3a55af3...ad529a448b
1
vendor/go.etcd.io/etcd
generated
vendored
Submodule
1
vendor/go.etcd.io/etcd
generated
vendored
Submodule
Submodule vendor/go.etcd.io/etcd added at 3cf2f69b57
2
vendor/google.golang.org/grpc
generated
vendored
2
vendor/google.golang.org/grpc
generated
vendored
Submodule vendor/google.golang.org/grpc updated: 5b3c4e850e...39e8a7b072
Reference in New Issue
Block a user