THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Browse Source

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.
codeql
James Shubin 1 year ago
parent
commit
e73007c398
  1. 2
      .gitmodules
  2. 12
      etcd/callback.go
  3. 2
      etcd/chooser/chooser.go
  4. 4
      etcd/chooser/dynamicsize.go
  5. 2
      etcd/client/resources/resources.go
  6. 10
      etcd/client/simple.go
  7. 4
      etcd/client/str/str.go
  8. 4
      etcd/client/strmap/strmap.go
  9. 2
      etcd/converger.go
  10. 4
      etcd/deployer/deployer.go
  11. 10
      etcd/etcd.go
  12. 4
      etcd/fs/file.go
  13. 4
      etcd/fs/fs.go
  14. 8
      etcd/helpers.go
  15. 4
      etcd/interfaces/client.go
  16. 10
      etcd/membership.go
  17. 6
      etcd/methods.go
  18. 4
      etcd/scheduler/scheduler.go
  19. 6
      etcd/server.go
  20. 2
      etcd/util.go
  21. 2
      lib/main.go
  22. 2
      spec.in
  23. 1
      vendor/github.com/coreos/etcd
  24. 2
      vendor/github.com/grpc-ecosystem/go-grpc-prometheus
  25. 2
      vendor/github.com/grpc-ecosystem/grpc-gateway
  26. 1
      vendor/go.etcd.io/etcd
  27. 2
      vendor/google.golang.org/grpc

2
.gitmodules

@ -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

12
etcd/callback.go

@ -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 {

2
etcd/chooser/chooser.go

@ -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.

4
etcd/chooser/dynamicsize.go

@ -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:

2
etcd/client/resources/resources.go

@ -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 (

10
etcd/client/simple.go

@ -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 {

4
etcd/client/str/str.go

@ -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 (

4
etcd/client/strmap/strmap.go

@ -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 (

2
etcd/converger.go

@ -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.

4
etcd/deployer/deployer.go

@ -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

@ -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 (

4
etcd/fs/file.go

@ -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() {

4
etcd/fs/fs.go

@ -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() {

8
etcd/helpers.go

@ -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

4
etcd/interfaces/client.go

@ -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.

10
etcd/membership.go

@ -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() {

6
etcd/methods.go

@ -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

4
etcd/scheduler/scheduler.go

@ -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 (

6
etcd/server.go

@ -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!

2
etcd/util.go

@ -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.

2
lib/main.go

@ -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

@ -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

@ -1 +0,0 @@
Subproject commit 98d308426819d892e149fe45f6fd542464cb1f9d

2
vendor/github.com/grpc-ecosystem/go-grpc-prometheus

@ -1 +1 @@
Subproject commit 0dafe0d496ea71181bf2dd039e7e3f44b6bd11a7
Subproject commit c225b8c3b01faf2899099b768856a9e916e5087b

2
vendor/github.com/grpc-ecosystem/grpc-gateway

@ -1 +1 @@
Subproject commit 8cc3a55af3bcf171a1c23a90c4df9cf591706104
Subproject commit ad529a448ba494a88058f9e5be0988713174ac86

1
vendor/go.etcd.io/etcd

@ -0,0 +1 @@
Subproject commit 3cf2f69b5738fb702ba1a935590f36b52b18979b

2
vendor/google.golang.org/grpc

@ -1 +1 @@
Subproject commit 5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e
Subproject commit 39e8a7b072a67ca2a75f57fa2e0d50995f5b22f6
Loading…
Cancel
Save