Skip to content

Commit fa8db37

Browse files
authored
Update cloud-sdk-go to 1.14.0 (#622)
Updates the SDK, and also fixes some problems with the build: - golangci-lint 1.50.1 doesn't work when go 1.20 is installed -> updated to latest version - updated go everywhere to 1.20 - removed golint, as it is deprecated and unmaintainted. According to the golint site, `go vet` is a replacement - with 1.20, `rand.Seed` is deprecated and the random number generator is seeded randomly by default
1 parent fd37558 commit fa8db37

File tree

10 files changed

+20
-31
lines changed

10 files changed

+20
-31
lines changed

.github/workflows/branch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Set up Go
2929
uses: actions/setup-go@v4
3030
with:
31-
go-version: 1.19
31+
go-version: "1.20"
3232
id: go
3333

3434
- name: Bump main version
@@ -64,7 +64,7 @@ jobs:
6464
- name: Set up Go
6565
uses: actions/setup-go@v4
6666
with:
67-
go-version: 1.19
67+
go-version: "1.20"
6868
id: go
6969

7070
- name: Bump main version

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- name: Set up Go
1111
uses: actions/setup-go@v4
1212
with:
13-
go-version: 1.19
13+
go-version: "1.20"
1414
id: go
1515

1616
- name: Check out code into the Go module directory

.github/workflows/on_master_generation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Go
1717
uses: actions/setup-go@v4
1818
with:
19-
go-version: 1.19
19+
go-version: "1.20"
2020
id: go
2121

2222
- run: make format

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Go
2020
uses: actions/setup-go@v4
2121
with:
22-
go-version: 1.19
22+
go-version: "1.20"
2323
id: go
2424

2525
- name: Cache Go Modules

NOTICE

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ecctl
2-
Copyright 2019-2022 Elasticsearch B.V.
2+
Copyright 2019-2023 Elasticsearch B.V.
33

44
This product includes software developed at Elasticsearch B.V. and
55
third-party software developed by the licenses listed below.
@@ -21,7 +21,6 @@ github.com/go-openapi/validate Apache-2.0
2121
github.com/inconshreveable/mousetrap Apache-2.0
2222
github.com/oklog/ulid Apache-2.0
2323
github.com/opentracing/opentracing-go Apache-2.0
24-
github.com/pelletier/go-toml Apache-2.0
2524
github.com/spf13/afero Apache-2.0
2625
github.com/spf13/cobra Apache-2.0
2726
go.mongodb.org/mongo-driver Apache-2.0
@@ -31,31 +30,32 @@ gopkg.in/yaml.v3 Apache-2.0
3130
github.com/magiconair/properties BSD-2-Clause
3231
github.com/pkg/errors BSD-2-Clause
3332
github.com/russross/blackfriday/v2 BSD-2-Clause
34-
github.com/puerkitobio/purell BSD-3-Clause
35-
github.com/puerkitobio/urlesc BSD-3-Clause
3633
github.com/fsnotify/fsnotify BSD-3-Clause
3734
github.com/pmezard/go-difflib BSD-3-Clause
35+
github.com/sagikazarmark/slog-shim BSD-3-Clause
3836
github.com/spf13/pflag BSD-3-Clause
39-
golang.org/x/net BSD-3-Clause
37+
golang.org/x/exp BSD-3-Clause
4038
golang.org/x/sys BSD-3-Clause
4139
golang.org/x/term BSD-3-Clause
4240
golang.org/x/text BSD-3-Clause
4341
github.com/asaskevich/govalidator MIT
4442
github.com/blang/semver/v4 MIT
4543
github.com/cpuguy83/go-md2man/v2 MIT
46-
github.com/go-stack/stack MIT
4744
github.com/josharian/intern MIT
4845
github.com/mailru/easyjson MIT
4946
github.com/mitchellh/mapstructure MIT
5047
github.com/pelletier/go-toml/v2 MIT
48+
github.com/sagikazarmark/locafero MIT
49+
github.com/sourcegraph/conc MIT
5150
github.com/spf13/cast MIT
52-
github.com/spf13/jwalterweatherman MIT
5351
github.com/spf13/viper MIT
5452
github.com/stretchr/testify MIT
5553
github.com/subosito/gotenv MIT
54+
go.uber.org/atomic MIT
55+
go.uber.org/multierr MIT
5656
github.com/hashicorp/errwrap MPL-2.0
57-
github.com/hashicorp/go-multierror MPL-2.0
5857
github.com/hashicorp/hcl MPL-2.0
58+
github.com/hashicorp/go-multierror MPL-2.0-no-copyleft-exception
5959
github.com/ghodss/yaml no license file was found
6060

6161
=========================================================================

build/Makefile.deps

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,20 @@ OS:=$(shell uname -s | tr '[:upper:]' '[:lower:]')
44
ARCH:=$(shell $(PWD)/scripts/uname_arch.sh)
55
VERSION_DIR:=$(GOBIN)/versions
66

7-
VERSION_GOLINT:=v0.0.0-20191125180803-fdd1cda4f05f
87
VERSION_GOLICENSER:=v0.3.0
9-
VERSION_GOLANGCILINT:=v1.50.1
8+
VERSION_GOLANGCILINT:=v1.54.2
109
VERSION_GOBINDATA:=v0.0.0-20190711162640-ee3c2418e368
1110
VERSION_GORELEASER:=v1.2.5
1211
VERSION_VERSIONBUMP:=v1.1.0
1312

14-
deps: $(GOBIN)/golint $(GOBIN)/go-licenser $(GOBIN)/golangci-lint $(GOBIN)/go-bindata
13+
deps: $(GOBIN)/go-licenser $(GOBIN)/golangci-lint $(GOBIN)/go-bindata
1514

1615
$(GOBIN):
1716
@ mkdir -p $(GOBIN)
1817

1918
$(VERSION_DIR): | $(GOBIN)
2019
@ mkdir -p $(GOBIN)/versions
2120

22-
$(VERSION_DIR)/.version-golint-$(VERSION_GOLINT): | $(VERSION_DIR)
23-
@ rm -f $(VERSION_DIR)/.version-golint-*
24-
@ echo $(VERSION_GOLINT) > $(VERSION_DIR)/.version-golint-$(VERSION_GOLINT)
25-
26-
$(GOBIN)/golint: $(VERSION_DIR)/.version-golint-$(VERSION_GOLINT) | $(GOBIN)
27-
@ echo "-> Installing golint..."
28-
@ go install golang.org/x/lint/golint@$(VERSION_GOLINT)
29-
3021
$(VERSION_DIR)/.version-go-licenser-$(VERSION_GOLICENSER): | $(VERSION_DIR)
3122
@ rm -f $(VERSION_DIR)/.version-go-licenser-*
3223
@ echo $(VERSION_GOLICENSER) > $(VERSION_DIR)/.version-go-licenser-$(VERSION_GOLICENSER)

build/Makefile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ notice:
5555
.PHONY: lint
5656
lint: deps
5757
@ echo "-> Running linters..."
58-
@ $(GOBIN)/golint -set_exit_status cmd/... pkg/ecctl/... pkg/util/...
58+
@ go vet
5959
@ $(GOBIN)/golangci-lint run --deadline=5m
6060
@ $(GOBIN)/go-licenser -d .
6161
@ echo "-> Done."

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module github.com/elastic/ecctl
22

3-
go 1.19
3+
go 1.20
44

55
require (
66
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
7-
github.com/elastic/cloud-sdk-go v1.13.0
7+
github.com/elastic/cloud-sdk-go v1.14.0
88
github.com/go-openapi/runtime v0.23.0
99
github.com/go-openapi/strfmt v0.21.2
1010
github.com/pkg/errors v0.9.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
7070
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
7171
github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
7272
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
73-
github.com/elastic/cloud-sdk-go v1.13.0 h1:mngeBF+dobwinwkQUpSDjBqg1YN2q7TVgWEYMzREChk=
74-
github.com/elastic/cloud-sdk-go v1.13.0/go.mod h1:dh2fVOBz598EslgiYW2az816DziJF5HQkzGOjf60Qj0=
73+
github.com/elastic/cloud-sdk-go v1.14.0 h1:BrteR1slcLxMG080381ov5g5dhwcGug7unp/+8+8ZQg=
74+
github.com/elastic/cloud-sdk-go v1.14.0/go.mod h1:dh2fVOBz598EslgiYW2az816DziJF5HQkzGOjf60Qj0=
7575
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
7676
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
7777
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=

pkg/util/random.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@ package util
1919

2020
import (
2121
"math/rand"
22-
"time"
2322
)
2423

2524
const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
2625

2726
// RandomString generates a random strings with a defined length.
2827
func RandomString(n int) string {
29-
rand.Seed(time.Now().UnixNano())
3028
b := make([]byte, n)
3129
for i := range b {
3230
b[i] = letterBytes[rand.Intn(len(letterBytes))]

0 commit comments

Comments
 (0)