Skip to content

Commit 143bc30

Browse files
authored
[Update] Update Go to 1.17 (#877)
1 parent 5846a3f commit 143bc30

17 files changed

+93
-27
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: go
22

33
go:
4-
- "1.16"
4+
- "1.17"
55

66
go_import_path: github.com/arangodb/kube-arangodb
77

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- Add ArangoClusterSynchronization v1 API
1212
- Add core containers names to follow their terminations
1313
- Add ArangoJob and Apps Operator
14+
- Use Go 1.17
1415

1516
## [1.2.6](https://github.com/arangodb/kube-arangodb/tree/1.2.6) (2021-12-15)
1617
- Add ArangoBackup backoff functionality

Dockerfile.debug

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
FROM golang:1.16 as builder
1+
ARG GOVERSION
2+
ARG DISTRIBUTION
3+
FROM golang:${GOVERSION} as builder
24

35
ARG TARGETARCH
46

5-
RUN apt-get update && apt-get install -y build-essential
7+
RUN apk add g++ make
68
RUN go install github.com/go-delve/delve/cmd/dlv@latest
79

8-
FROM alpine:3.14 as artifact
10+
FROM ${DISTRIBUTION} as artifact
911

1012
ARG RELEASE_MODE
1113
ARG TARGETARCH

MAINTAINERS.md

+7
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,10 @@ Please add following to your `~/bashrc` or `~/.zshrc` file (it requires Homebrew
102102
HOMEBREW_PREFIX=$(brew --prefix)
103103
for d in ${HOMEBREW_PREFIX}/opt/*/libexec/gnubin; do export PATH=$d:$PATH; done
104104
```
105+
106+
## Change Go version
107+
#### Change file Makefile
108+
* GOVERSION := e.g. 1.17-alpine3.15
109+
* DISTRIBUTION := e.g. alpine:3.15
110+
#### Change file .travis.yml
111+
#### Change file go.mod

Makefile

+12-7
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ REPOPATH := $(ORGPATH)/$(REPONAME)
3232
include $(ROOT)/$(RELEASE_MODE).mk
3333

3434
GOPATH := $(GOBUILDDIR)
35-
GOVERSION := 1.10.0-alpine
35+
GOVERSION := 1.17-alpine3.15
36+
DISTRIBUTION := alpine:3.15
3637

3738
PULSAR := $(GOBUILDDIR)/bin/pulsar$(shell go env GOEXE)
3839
GOASSETSBUILDER := $(GOBUILDDIR)/bin/go-assets-builder$(shell go env GOEXE)
@@ -281,9 +282,13 @@ $(BIN): $(VBIN_LINUX_AMD64)
281282
.PHONY: docker
282283
docker: check-vars $(VBIN_LINUX_AMD64) $(VBIN_LINUX_ARM64)
283284
ifdef PUSHIMAGES
284-
docker buildx build --no-cache -f $(DOCKERFILE) --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" --platform linux/amd64,linux/arm64 --push -t $(OPERATORIMAGE) .
285+
docker buildx build --no-cache -f $(DOCKERFILE) --build-arg GOVERSION=$(GOVERSION) --build-arg DISTRIBUTION=$(DISTRIBUTION) \
286+
--build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" \
287+
--platform linux/amd64,linux/arm64 --push -t $(OPERATORIMAGE) .
285288
else
286-
docker buildx build --no-cache -f $(DOCKERFILE) --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" --platform linux/amd64,linux/arm64 -t $(OPERATORIMAGE) .
289+
docker buildx build --no-cache -f $(DOCKERFILE) --build-arg GOVERSION=$(GOVERSION) --build-arg DISTRIBUTION=$(DISTRIBUTION) \
290+
--build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" \
291+
--platform linux/amd64,linux/arm64 -t $(OPERATORIMAGE) .
287292
endif
288293

289294
.PHONY: docker-ubi
@@ -392,7 +397,7 @@ run-unit-tests: $(SOURCES)
392397
$(REPOPATH)/pkg/deployment/... \
393398
$(REPOPATH)/pkg/storage \
394399
$(REPOPATH)/pkg/util/... \
395-
$(REPOPATH)/pkg/backup/...
400+
$(REPOPATH)/pkg/handlers/...
396401

397402
# Release building
398403

@@ -450,7 +455,7 @@ set-api-version/%:
450455
"$(ROOT)/pkg/operator/" \
451456
"$(ROOT)/pkg/server/" \
452457
"$(ROOT)/pkg/util/" \
453-
"$(ROOT)/pkg/backup/" \
458+
"$(ROOT)/pkg/handlers/" \
454459
"$(ROOT)/pkg/apis/backup/" \
455460
| cut -d ':' -f 1 | sort | uniq \
456461
| xargs -n 1 sed -i "s#github.com/arangodb/kube-arangodb/pkg/apis/$*/v[A-Za-z0-9]\+#github.com/arangodb/kube-arangodb/pkg/apis/$*/v$(API_VERSION)#g"
@@ -460,7 +465,7 @@ set-api-version/%:
460465
"$(ROOT)/pkg/operator/" \
461466
"$(ROOT)/pkg/server/" \
462467
"$(ROOT)/pkg/util/" \
463-
"$(ROOT)/pkg/backup/" \
468+
"$(ROOT)/pkg/handlers/" \
464469
"$(ROOT)/pkg/apis/backup/" \
465470
| cut -d ':' -f 1 | sort | uniq \
466471
| xargs -n 1 sed -i "s#DatabaseV[A-Za-z0-9]\+()\.#DatabaseV$(API_VERSION)().#g"
@@ -470,7 +475,7 @@ set-api-version/%:
470475
"$(ROOT)/pkg/operator/" \
471476
"$(ROOT)/pkg/server/" \
472477
"$(ROOT)/pkg/util/" \
473-
"$(ROOT)/pkg/backup/" \
478+
"$(ROOT)/pkg/handlers" \
474479
"$(ROOT)/pkg/apis/backup/" \
475480
| cut -d ':' -f 1 | sort | uniq \
476481
| xargs -n 1 sed -i "s#ReplicationV[A-Za-z0-9]\+()\.#ReplicationV$(API_VERSION)().#g"

go.mod

+56-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/arangodb/kube-arangodb
22

3-
go 1.16
3+
go 1.17
44

55
replace (
66
github.com/arangodb/go-driver => github.com/arangodb/go-driver v1.2.1
@@ -31,22 +31,12 @@ require (
3131
//github.com/arangodb/rebalancer v0.1.1
3232
github.com/cenkalti/backoff v2.2.1+incompatible
3333
github.com/dchest/uniuri v0.0.0-20160212164326-8902c56451e9
34-
github.com/evanphx/json-patch v4.9.0+incompatible // indirect
3534
github.com/ghodss/yaml v1.0.0
3635
github.com/gin-gonic/gin v1.7.2
37-
github.com/go-playground/validator/v10 v10.8.0 // indirect
3836
github.com/golang-jwt/jwt v3.2.2+incompatible
39-
github.com/golang/protobuf v1.5.2 // indirect
40-
github.com/google/addlicense v0.0.0-20210428195630-6d92264d7170 // indirect
41-
github.com/hashicorp/golang-lru v0.5.3 // indirect
4237
github.com/jessevdk/go-assets v0.0.0-20160921144138-4f4301a06e15
43-
github.com/jessevdk/go-assets-builder v0.0.0-20130903091706-b8483521738f // indirect
44-
github.com/jessevdk/go-flags v1.5.0 // indirect
45-
github.com/json-iterator/go v1.1.11 // indirect
4638
github.com/julienschmidt/httprouter v1.3.0
4739
github.com/magiconair/properties v1.8.5
48-
github.com/mattn/go-isatty v0.0.13 // indirect
49-
github.com/onsi/gomega v1.7.1 // indirect
5040
github.com/pkg/errors v0.9.1
5141
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.44.1
5242
github.com/prometheus-operator/prometheus-operator/pkg/client v0.0.0-00010101000000-000000000000
@@ -57,15 +47,65 @@ require (
5747
github.com/spf13/cobra v1.2.1
5848
github.com/spf13/pflag v1.0.5
5949
github.com/stretchr/testify v1.7.0
60-
github.com/ugorji/go/codec v1.2.6 // indirect
61-
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect
6250
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c
63-
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
64-
google.golang.org/protobuf v1.27.1 // indirect
65-
gopkg.in/yaml.v2 v2.4.0 // indirect
6651
k8s.io/api v0.19.8
6752
k8s.io/apiextensions-apiserver v0.18.3
6853
k8s.io/apimachinery v0.19.8
6954
k8s.io/client-go v12.0.0+incompatible
7055
k8s.io/klog v1.0.0
7156
)
57+
58+
require (
59+
github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e // indirect
60+
github.com/beorn7/perks v1.0.1 // indirect
61+
github.com/cespare/xxhash/v2 v2.1.1 // indirect
62+
github.com/davecgh/go-spew v1.1.1 // indirect
63+
github.com/evanphx/json-patch v4.9.0+incompatible // indirect
64+
github.com/gin-contrib/sse v0.1.0 // indirect
65+
github.com/go-logr/logr v0.2.0 // indirect
66+
github.com/go-playground/locales v0.13.0 // indirect
67+
github.com/go-playground/universal-translator v0.17.0 // indirect
68+
github.com/go-playground/validator/v10 v10.8.0 // indirect
69+
github.com/gogo/protobuf v1.3.2 // indirect
70+
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
71+
github.com/golang/protobuf v1.5.2 // indirect
72+
github.com/google/addlicense v0.0.0-20210428195630-6d92264d7170 // indirect
73+
github.com/google/go-cmp v0.5.5 // indirect
74+
github.com/google/gofuzz v1.1.0 // indirect
75+
github.com/google/uuid v1.1.2 // indirect
76+
github.com/googleapis/gnostic v0.4.1 // indirect
77+
github.com/hashicorp/golang-lru v0.5.3 // indirect
78+
github.com/imdario/mergo v0.3.5 // indirect
79+
github.com/inconshreveable/mousetrap v1.0.0 // indirect
80+
github.com/jessevdk/go-assets-builder v0.0.0-20130903091706-b8483521738f // indirect
81+
github.com/jessevdk/go-flags v1.5.0 // indirect
82+
github.com/json-iterator/go v1.1.11 // indirect
83+
github.com/leodido/go-urn v1.2.1 // indirect
84+
github.com/mattn/go-isatty v0.0.13 // indirect
85+
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
86+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
87+
github.com/modern-go/reflect2 v1.0.1 // indirect
88+
github.com/onsi/gomega v1.7.1 // indirect
89+
github.com/pavel-v-chernykh/keystore-go v2.1.0+incompatible // indirect
90+
github.com/pmezard/go-difflib v1.0.0 // indirect
91+
github.com/prometheus/common v0.10.0 // indirect
92+
github.com/prometheus/procfs v0.1.3 // indirect
93+
github.com/stretchr/objx v0.2.0 // indirect
94+
github.com/ugorji/go/codec v1.2.6 // indirect
95+
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect
96+
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect
97+
golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602 // indirect
98+
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
99+
golang.org/x/text v0.3.6 // indirect
100+
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
101+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
102+
google.golang.org/appengine v1.6.7 // indirect
103+
google.golang.org/protobuf v1.27.1 // indirect
104+
gopkg.in/inf.v0 v0.9.1 // indirect
105+
gopkg.in/yaml.v2 v2.4.0 // indirect
106+
k8s.io/klog/v2 v2.2.0 // indirect
107+
k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6 // indirect
108+
k8s.io/utils v0.0.0-20200729134348-d5654de09c73 // indirect
109+
sigs.k8s.io/structured-merge-diff/v4 v4.0.1 // indirect
110+
sigs.k8s.io/yaml v1.2.0 // indirect
111+
)

pkg/deployment/members.community.go

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// Copyright holder is ArangoDB GmbH, Cologne, Germany
1919
//
2020

21+
//go:build !enterprise
2122
// +build !enterprise
2223

2324
package deployment

pkg/deployment/pod/topology.community.go

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// Copyright holder is ArangoDB GmbH, Cologne, Germany
1919
//
2020

21+
//go:build !enterprise
2122
// +build !enterprise
2223

2324
package pod

pkg/deployment/reconcile/action_topology_disable.community.go

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// Copyright holder is ArangoDB GmbH, Cologne, Germany
1919
//
2020

21+
//go:build !enterprise
2122
// +build !enterprise
2223

2324
package reconcile

pkg/deployment/reconcile/action_topology_enable.community.go

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// Copyright holder is ArangoDB GmbH, Cologne, Germany
1919
//
2020

21+
//go:build !enterprise
2122
// +build !enterprise
2223

2324
package reconcile

pkg/deployment/reconcile/action_topology_member_assignment.community.go

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// Copyright holder is ArangoDB GmbH, Cologne, Germany
1919
//
2020

21+
//go:build !enterprise
2122
// +build !enterprise
2223

2324
package reconcile

pkg/deployment/reconcile/action_topology_zones_update.community.go

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// Copyright holder is ArangoDB GmbH, Cologne, Germany
1919
//
2020

21+
//go:build !enterprise
2122
// +build !enterprise
2223

2324
package reconcile

pkg/deployment/reconcile/plan_builder_rebalancer.community.go

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// Copyright holder is ArangoDB GmbH, Cologne, Germany
1919
//
2020

21+
//go:build !enterprise
2122
// +build !enterprise
2223

2324
package reconcile

pkg/deployment/reconcile/plan_builder_topology.community.go

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// Copyright holder is ArangoDB GmbH, Cologne, Germany
1919
//
2020

21+
//go:build !enterprise
2122
// +build !enterprise
2223

2324
package reconcile

pkg/deployment/topology/mods.community.go

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// Copyright holder is ArangoDB GmbH, Cologne, Germany
1919
//
2020

21+
//go:build !enterprise
2122
// +build !enterprise
2223

2324
package topology

pkg/deployment/topology/topology.community.go

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// Copyright holder is ArangoDB GmbH, Cologne, Germany
1919
//
2020

21+
//go:build !enterprise
2122
// +build !enterprise
2223

2324
package topology

pkg/version/version.community.go

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// Copyright holder is ArangoDB GmbH, Cologne, Germany
1919
//
2020

21+
//go:build !enterprise
2122
// +build !enterprise
2223

2324
package version

0 commit comments

Comments
 (0)