Skip to content

Commit 73c4a4c

Browse files
authored
Merge pull request hashicorp#31326 from hashicorp/jbardin/remove-etcd-backend
remove unmaintained etcd backend to update grpc packages
2 parents f83c8e1 + 953c448 commit 73c4a4c

16 files changed

Lines changed: 115 additions & 300 deletions

File tree

‎go.mod‎

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ require (
2424
github.com/dylanmei/winrmtest v0.0.0-20210303004826-fbc9ae56efb6
2525
github.com/go-test/deep v1.0.3
2626
github.com/golang/mock v1.6.0
27-
github.com/golang/protobuf v1.5.2
2827
github.com/google/go-cmp v0.5.6
2928
github.com/google/uuid v1.2.0
3029
github.com/gophercloud/gophercloud v0.10.1-0.20200424014253-c3bfe50899e5
@@ -81,7 +80,8 @@ require (
8180
github.com/zclconf/go-cty v1.10.0
8281
github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b
8382
github.com/zclconf/go-cty-yaml v1.0.2
84-
go.etcd.io/etcd v0.5.0-alpha.5.0.20210428180535-15715dcf1ace
83+
go.etcd.io/etcd/client/pkg/v3 v3.5.4
84+
go.etcd.io/etcd/client/v3 v3.5.4
8585
golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898
8686
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4
8787
golang.org/x/net v0.0.0-20211216030914-fe4d6282115f
@@ -91,7 +91,7 @@ require (
9191
golang.org/x/text v0.3.7
9292
golang.org/x/tools v0.1.11
9393
google.golang.org/api v0.44.0-impersonate-preview
94-
google.golang.org/grpc v1.36.1
94+
google.golang.org/grpc v1.47.0
9595
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0
9696
google.golang.org/protobuf v1.27.1
9797
honnef.co/go/tools v0.3.0
@@ -126,8 +126,9 @@ require (
126126
github.com/armon/go-radix v1.0.0 // indirect
127127
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect
128128
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
129-
github.com/coreos/go-semver v0.2.0 // indirect
129+
github.com/coreos/go-semver v0.3.0 // indirect
130130
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d // indirect
131+
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
131132
github.com/creack/pty v1.1.18 // indirect
132133
github.com/dimchansky/utfbom v1.1.1 // indirect
133134
github.com/dylanmei/iso8601 v0.1.0 // indirect
@@ -137,6 +138,7 @@ require (
137138
github.com/gogo/protobuf v1.3.2 // indirect
138139
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
139140
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
141+
github.com/golang/protobuf v1.5.2 // indirect
140142
github.com/google/go-querystring v1.1.0 // indirect
141143
github.com/google/gofuzz v1.1.0 // indirect
142144
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
@@ -174,16 +176,17 @@ require (
174176
github.com/ulikunitz/xz v0.5.8 // indirect
175177
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect
176178
github.com/vmihailenco/tagparser v0.1.1 // indirect
179+
go.etcd.io/etcd/api/v3 v3.5.4 // indirect
177180
go.opencensus.io v0.23.0 // indirect
178-
go.uber.org/atomic v1.3.2 // indirect
179-
go.uber.org/multierr v1.1.0 // indirect
180-
go.uber.org/zap v1.10.0 // indirect
181+
go.uber.org/atomic v1.7.0 // indirect
182+
go.uber.org/multierr v1.6.0 // indirect
183+
go.uber.org/zap v1.17.0 // indirect
181184
golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect
182-
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect
185+
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
183186
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65 // indirect
184187
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
185188
google.golang.org/appengine v1.6.7 // indirect
186-
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1 // indirect
189+
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
187190
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
188191
gopkg.in/inf.v0 v0.9.1 // indirect
189192
gopkg.in/ini.v1 v1.66.2 // indirect
@@ -196,14 +199,6 @@ require (
196199
sigs.k8s.io/yaml v1.2.0 // indirect
197200
)
198201

199-
replace google.golang.org/grpc v1.36.1 => google.golang.org/grpc v1.27.1
200-
201202
replace github.com/golang/mock v1.5.0 => github.com/golang/mock v1.4.4
202203

203-
// github.com/dgrijalva/jwt-go is no longer maintained but is an indirect
204-
// dependency of the old etcdv2 backend, and so we need to keep this working
205-
// until that backend is removed. github.com/golang-jwt/jwt/v3 is a drop-in
206-
// replacement that includes a fix for CVE-2020-26160.
207-
replace github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt v3.2.1+incompatible
208-
209204
go 1.18

‎go.sum‎

Lines changed: 71 additions & 66 deletions
Large diffs are not rendered by default.

‎internal/backend/init/init.go‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
backendAzure "github.com/hashicorp/terraform/internal/backend/remote-state/azure"
1717
backendConsul "github.com/hashicorp/terraform/internal/backend/remote-state/consul"
1818
backendCos "github.com/hashicorp/terraform/internal/backend/remote-state/cos"
19-
backendEtcdv2 "github.com/hashicorp/terraform/internal/backend/remote-state/etcdv2"
2019
backendEtcdv3 "github.com/hashicorp/terraform/internal/backend/remote-state/etcdv3"
2120
backendGCS "github.com/hashicorp/terraform/internal/backend/remote-state/gcs"
2221
backendHTTP "github.com/hashicorp/terraform/internal/backend/remote-state/http"
@@ -44,6 +43,10 @@ import (
4443
var backends map[string]backend.InitFn
4544
var backendsLock sync.Mutex
4645

46+
// RemovedBackends is a record of previously supported backends which have
47+
// since been deprecated and removed.
48+
var RemovedBackends map[string]string
49+
4750
// Init initializes the backends map with all our hardcoded backends.
4851
func Init(services *disco.Disco) {
4952
backendsLock.Lock()
@@ -83,12 +86,6 @@ func Init(services *disco.Disco) {
8386
`Warning: "artifactory" backend is deprecated, and will be removed in a future release."`,
8487
)
8588
},
86-
"etcd": func() backend.Backend {
87-
return deprecateBackend(
88-
backendEtcdv2.New(),
89-
`Warning: "etcd" backend is deprecated, and will be removed in a future release."`,
90-
)
91-
},
9289
"etcdv3": func() backend.Backend {
9390
return deprecateBackend(
9491
backendEtcdv3.New(),
@@ -108,6 +105,10 @@ func Init(services *disco.Disco) {
108105
)
109106
},
110107
}
108+
109+
RemovedBackends = map[string]string{
110+
"etcd": `The "etcd" backend is not supported in Terraform v1.3 or later.`,
111+
}
111112
}
112113

113114
// Backend returns the initialization factory for the given backend, or

‎internal/backend/init/init_test.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ func TestInit_backend(t *testing.T) {
2525

2626
{"azure", "init.deprecatedBackendShim"},
2727
{"artifactory", "init.deprecatedBackendShim"},
28-
{"etcd", "init.deprecatedBackendShim"},
2928
{"etcdv3", "init.deprecatedBackendShim"},
3029
{"manta", "init.deprecatedBackendShim"},
3130
{"swift", "init.deprecatedBackendShim"},

‎internal/backend/remote-state/etcdv2/backend.go‎

Lines changed: 0 additions & 96 deletions
This file was deleted.

‎internal/backend/remote-state/etcdv2/backend_test.go‎

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎internal/backend/remote-state/etcdv2/client.go‎

Lines changed: 0 additions & 46 deletions
This file was deleted.

‎internal/backend/remote-state/etcdv2/client_test.go‎

Lines changed: 0 additions & 45 deletions
This file was deleted.

‎internal/backend/remote-state/etcdv3/backend.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55

66
"github.com/hashicorp/terraform/internal/backend"
77
"github.com/hashicorp/terraform/internal/legacy/helper/schema"
8-
etcdv3 "go.etcd.io/etcd/clientv3"
9-
"go.etcd.io/etcd/pkg/transport"
8+
"go.etcd.io/etcd/client/pkg/v3/transport"
9+
etcdv3 "go.etcd.io/etcd/client/v3"
1010
)
1111

1212
const (

‎internal/backend/remote-state/etcdv3/backend_state.go‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ import (
66
"sort"
77
"strings"
88

9-
etcdv3 "go.etcd.io/etcd/clientv3"
10-
119
"github.com/hashicorp/terraform/internal/backend"
1210
"github.com/hashicorp/terraform/internal/states"
1311
"github.com/hashicorp/terraform/internal/states/remote"
1412
"github.com/hashicorp/terraform/internal/states/statemgr"
13+
etcdv3 "go.etcd.io/etcd/client/v3"
1514
)
1615

1716
func (b *Backend) Workspaces() ([]string, error) {

0 commit comments

Comments
 (0)