Skip to content

Commit

Permalink
Upgrade etcd to 3.4.10, use go.etcd.io import path (#3939)
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Chlebek <[email protected]>
  • Loading branch information
echlebek authored Jul 23, 2020
1 parent 932413f commit 9c8d2b0
Show file tree
Hide file tree
Showing 80 changed files with 419 additions and 103 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:
lint-api-core-v3-mod:
name: lint-api-core-v3-mod
runs-on: ubuntu-latest
env:
GOSUMDB: off
GOPROXY: direct
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ characters.
- Enriches output of `sensuctl asset add` with help usage for how to use the runtime asset.
- Unless the entity is a proxy entity, updates to entities now ignore state
related fields.
- Upgraded embedded etcd to 3.4.10

## [5.21.0] - 2020-06-10

Expand Down
1 change: 1 addition & 0 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ func (a *Agent) connectionManager(ctx context.Context, cancel context.CancelFunc

// Do not handle check request until we receive the entity config from the
// backend, so we don't send a stale config

a.handler.AddHandler(corev2.CheckRequestType, a.handleCheckNoop)

a.clearAgentEntity()
Expand Down
5 changes: 3 additions & 2 deletions api/core/v2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ module github.com/sensu/sensu-go/api/core/v2

go 1.13

replace go.etcd.io/etcd => go.etcd.io/etcd v0.0.0-20200716221620-18dfb9cca345

require (
github.com/coreos/etcd v3.3.17+incompatible
github.com/coreos/go-semver v0.3.0 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/echlebek/crock v1.0.1
Expand All @@ -16,8 +17,8 @@ require (
github.com/robfig/cron/v3 v3.0.1
github.com/sirupsen/logrus v1.6.0
github.com/stretchr/testify v1.6.0
go.etcd.io/etcd v3.4.10+incompatible
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect
google.golang.org/grpc v1.24.0 // indirect
gopkg.in/sourcemap.v1 v1.0.5 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
)
132 changes: 130 additions & 2 deletions api/core/v2/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion api/core/v2/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"

"github.com/coreos/etcd/etcdserver/etcdserverpb"
"go.etcd.io/etcd/etcdserver/etcdserverpb"
)

// ClusterHealth holds cluster member status info.
Expand Down
2 changes: 1 addition & 1 deletion api/core/v2/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package v2

import (
etcdVersion "github.com/coreos/etcd/version"
etcdVersion "go.etcd.io/etcd/version"
)

// Version holds the current etcd server and cluster version, and the sensu-backend version.
Expand Down
2 changes: 1 addition & 1 deletion api/core/v3/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ replace (
require (
github.com/gogo/protobuf v1.3.1
github.com/golang/protobuf v1.3.2
github.com/sensu/sensu-go/api/core/v2 v2.0.0
github.com/sensu/sensu-go/api/core/v2 v2.2.0
github.com/sensu/sensu-go/types v0.1.0
)
127 changes: 127 additions & 0 deletions api/core/v3/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion backend/agentd/agentd.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"sync/atomic"
"time"

"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
"github.com/gogo/protobuf/proto"
"github.com/gorilla/mux"
"github.com/gorilla/websocket"
Expand Down
2 changes: 1 addition & 1 deletion backend/agentd/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"errors"

"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
"github.com/gogo/protobuf/proto"
corev3 "github.com/sensu/sensu-go/api/core/v3"
"github.com/sensu/sensu-go/backend/messaging"
Expand Down
2 changes: 1 addition & 1 deletion backend/apid/actions/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package actions
import (
"context"

"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
"github.com/sensu/sensu-go/backend/store"
)

Expand Down
12 changes: 11 additions & 1 deletion backend/apid/actions/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"errors"
"testing"

"github.com/coreos/etcd/clientv3"
"github.com/google/uuid"
"github.com/sensu/sensu-go/backend/store"
"github.com/sensu/sensu-go/testing/mockstore"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"go.etcd.io/etcd/clientv3"
"golang.org/x/net/context"
)

Expand All @@ -30,6 +30,16 @@ func (mockCluster) MemberRemove(context.Context, uint64) (*clientv3.MemberRemove

func (mockCluster) MemberUpdate(context.Context, uint64, []string) (*clientv3.MemberUpdateResponse, error) {
return new(clientv3.MemberUpdateResponse), nil

}

func (mockCluster) MemberPromote(ctx context.Context, id uint64) (*clientv3.MemberPromoteResponse, error) {
return new(clientv3.MemberPromoteResponse), nil
}

// MemberAddAsLearner adds a new learner member into the cluster.
func (mockCluster) MemberAddAsLearner(ctx context.Context, peerAddrs []string) (*clientv3.MemberAddResponse, error) {
return new(clientv3.MemberAddResponse), nil
}

var _ clientv3.Cluster = mockCluster{}
Expand Down
2 changes: 1 addition & 1 deletion backend/apid/actions/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package actions
import (
"crypto/tls"

"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
corev2 "github.com/sensu/sensu-go/api/core/v2"
"github.com/sensu/sensu-go/backend/store"
"golang.org/x/net/context"
Expand Down
2 changes: 1 addition & 1 deletion backend/apid/actions/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package actions

import (
etcdVersion "github.com/coreos/etcd/version"
etcdVersion "go.etcd.io/etcd/version"
corev2 "github.com/sensu/sensu-go/api/core/v2"
"github.com/sensu/sensu-go/version"
"golang.org/x/net/context"
Expand Down
2 changes: 1 addition & 1 deletion backend/apid/apid.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"sync/atomic"
"time"

"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
"github.com/gorilla/mux"
"github.com/prometheus/client_golang/prometheus/promhttp"

Expand Down
2 changes: 1 addition & 1 deletion backend/apid/graphql/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package graphql
import (
"strconv"

"github.com/coreos/etcd/etcdserver/etcdserverpb"
"go.etcd.io/etcd/etcdserver/etcdserverpb"
corev2 "github.com/sensu/sensu-go/api/core/v2"
"github.com/sensu/sensu-go/backend/apid/graphql/schema"
"github.com/sensu/sensu-go/graphql"
Expand Down
2 changes: 1 addition & 1 deletion backend/apid/graphql/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"
"testing"

"github.com/coreos/etcd/etcdserver/etcdserverpb"
"go.etcd.io/etcd/etcdserver/etcdserverpb"
corev2 "github.com/sensu/sensu-go/api/core/v2"
"github.com/sensu/sensu-go/backend/apid/graphql/schema"
"github.com/sensu/sensu-go/graphql"
Expand Down
2 changes: 1 addition & 1 deletion backend/apid/routers/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"time"

"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
"github.com/gorilla/mux"
)

Expand Down
2 changes: 1 addition & 1 deletion backend/apid/routers/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http/httptest"
"testing"

"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
"github.com/google/uuid"
"github.com/gorilla/mux"
"github.com/stretchr/testify/mock"
Expand Down
4 changes: 2 additions & 2 deletions backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"syscall"
"time"

"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/pkg/transport"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/pkg/transport"
"github.com/prometheus/client_golang/prometheus"
"github.com/spf13/viper"
"golang.org/x/time/rate"
Expand Down
4 changes: 2 additions & 2 deletions backend/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"time"

"github.com/AlecAivazis/survey"
"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/pkg/transport"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/pkg/transport"
corev2 "github.com/sensu/sensu-go/api/core/v2"
"github.com/sensu/sensu-go/backend"
"github.com/sensu/sensu-go/backend/etcd"
Expand Down
4 changes: 2 additions & 2 deletions backend/cmd/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"time"

"github.com/AlecAivazis/survey"
"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/pkg/transport"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/pkg/transport"
corev2 "github.com/sensu/sensu-go/api/core/v2"
"github.com/sensu/sensu-go/backend"
"github.com/sensu/sensu-go/backend/etcd"
Expand Down
12 changes: 6 additions & 6 deletions backend/etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import (
"path/filepath"
"time"

"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/embed"
"github.com/coreos/etcd/etcdserver/api/v3client"
"github.com/coreos/etcd/pkg/transport"
etcdTypes "github.com/coreos/etcd/pkg/types"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/embed"
"go.etcd.io/etcd/etcdserver/api/v3client"
"go.etcd.io/etcd/pkg/transport"
etcdTypes "go.etcd.io/etcd/pkg/types"
"github.com/coreos/pkg/capnslog"
"github.com/sensu/sensu-go/util/path"
"google.golang.org/grpc"
Expand Down Expand Up @@ -125,7 +125,7 @@ func ensureDir(path string) error {
return nil
}

// Etcd is a wrapper around github.com/coreos/etcd/embed.Etcd
// Etcd is a wrapper around go.etcd.io/etcd/embed.Etcd
type Etcd struct {
cfg *Config
etcd *embed.Etcd
Expand Down
2 changes: 1 addition & 1 deletion backend/etcd/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"sync"
"sync/atomic"

"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
"github.com/sensu/sensu-go/backend/store"
)

Expand Down
2 changes: 1 addition & 1 deletion backend/etcd/id_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"sync"
"testing"

"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
)

type mockBackendIDGetterClient struct {
Expand Down
2 changes: 1 addition & 1 deletion backend/etcd/sequence.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"errors"
"fmt"

"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
)

var initialItemKey []byte
Expand Down
2 changes: 1 addition & 1 deletion backend/eventd/eventd.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"sync"
"time"

"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
"github.com/prometheus/client_golang/prometheus"
"github.com/sirupsen/logrus"

Expand Down
4 changes: 2 additions & 2 deletions backend/liveness/liveness.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"sync"
"time"

"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/mvcc/mvccpb"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/mvcc/mvccpb"
"github.com/sensu/sensu-go/backend/store/etcd"
"github.com/sirupsen/logrus"
"golang.org/x/time/rate"
Expand Down
4 changes: 2 additions & 2 deletions backend/queue/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"strconv"
"time"

"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/mvcc/mvccpb"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/mvcc/mvccpb"
"github.com/sensu/sensu-go/backend/store"
"github.com/sensu/sensu-go/backend/store/etcd"
"github.com/sensu/sensu-go/types"
Expand Down
2 changes: 1 addition & 1 deletion backend/ringv2/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package ringv2
import (
"sync"

"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
)

// Pool is a pool of rings. It exists to help users avoid creating too many
Expand Down
4 changes: 2 additions & 2 deletions backend/ringv2/ringv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"sync/atomic"
"time"

"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/mvcc/mvccpb"
"go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/mvcc/mvccpb"
cron "github.com/robfig/cron/v3"
"github.com/sensu/sensu-go/backend/store"
"github.com/sensu/sensu-go/backend/store/etcd"
Expand Down
2 changes: 1 addition & 1 deletion backend/schedulerd/schedulerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package schedulerd
import (
"context"

"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
"github.com/prometheus/client_golang/prometheus"
corev3 "github.com/sensu/sensu-go/api/core/v3"
"github.com/sensu/sensu-go/backend/messaging"
Expand Down
2 changes: 1 addition & 1 deletion backend/seeds/seeds.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"errors"
"time"

"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
corev2 "github.com/sensu/sensu-go/api/core/v2"
"github.com/sensu/sensu-go/backend/authentication/bcrypt"
"github.com/sensu/sensu-go/backend/store"
Expand Down
2 changes: 1 addition & 1 deletion backend/store/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"sync/atomic"
"time"

"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
corev2 "github.com/sensu/sensu-go/api/core/v2"
"github.com/sensu/sensu-go/backend/store"
"github.com/sensu/sensu-go/backend/store/etcd"
Expand Down
2 changes: 1 addition & 1 deletion backend/store/cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/sensu/sensu-go/backend/store/etcd"
"github.com/sensu/sensu-go/types"

"github.com/coreos/etcd/integration"
"go.etcd.io/etcd/integration"
corev2 "github.com/sensu/sensu-go/api/core/v2"
"github.com/sensu/sensu-go/backend/store"
"github.com/sensu/sensu-go/testing/fixture"
Expand Down
2 changes: 1 addition & 1 deletion backend/store/cache/v2/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"sync/atomic"
"time"

"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
corev3 "github.com/sensu/sensu-go/api/core/v3"
"github.com/sensu/sensu-go/backend/store"
storev2 "github.com/sensu/sensu-go/backend/store/v2"
Expand Down
2 changes: 1 addition & 1 deletion backend/store/cache/v2/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

"github.com/coreos/etcd/integration"
"go.etcd.io/etcd/integration"
corev2 "github.com/sensu/sensu-go/api/core/v2"
corev3 "github.com/sensu/sensu-go/api/core/v3"
"github.com/sensu/sensu-go/backend/store"
Expand Down
2 changes: 1 addition & 1 deletion backend/store/etcd/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"time"

"github.com/coreos/etcd/clientv3"
"go.etcd.io/etcd/clientv3"
"github.com/sensu/sensu-go/backend/store"
utilbytes "github.com/sensu/sensu-go/util/bytes"
)
Expand Down
Loading

0 comments on commit 9c8d2b0

Please sign in to comment.