diff --git a/.travis.yml b/.travis.yml index 4ef17c20a..0e9aee6cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: go go: - - "1.16" + - "1.17" go_import_path: github.com/arangodb/kube-arangodb diff --git a/CHANGELOG.md b/CHANGELOG.md index c1b638d74..f5db412ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Add ArangoClusterSynchronization v1 API - Add core containers names to follow their terminations - Add ArangoJob and Apps Operator +- Use Go 1.17 ## [1.2.6](https://github.com/arangodb/kube-arangodb/tree/1.2.6) (2021-12-15) - Add ArangoBackup backoff functionality diff --git a/Dockerfile.debug b/Dockerfile.debug index 5790de834..d194a5b90 100644 --- a/Dockerfile.debug +++ b/Dockerfile.debug @@ -1,11 +1,13 @@ -FROM golang:1.16 as builder +ARG GOVERSION +ARG DISTRIBUTION +FROM golang:${GOVERSION} as builder ARG TARGETARCH -RUN apt-get update && apt-get install -y build-essential +RUN apk add g++ make RUN go install github.com/go-delve/delve/cmd/dlv@latest -FROM alpine:3.14 as artifact +FROM ${DISTRIBUTION} as artifact ARG RELEASE_MODE ARG TARGETARCH diff --git a/MAINTAINERS.md b/MAINTAINERS.md index e39e8be48..742256704 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -102,3 +102,10 @@ Please add following to your `~/bashrc` or `~/.zshrc` file (it requires Homebrew HOMEBREW_PREFIX=$(brew --prefix) for d in ${HOMEBREW_PREFIX}/opt/*/libexec/gnubin; do export PATH=$d:$PATH; done ``` + +## Change Go version +#### Change file Makefile +* GOVERSION := e.g. 1.17-alpine3.15 +* DISTRIBUTION := e.g. alpine:3.15 +#### Change file .travis.yml +#### Change file go.mod diff --git a/Makefile b/Makefile index 5f9bb5a09..11f21ce3a 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,8 @@ REPOPATH := $(ORGPATH)/$(REPONAME) include $(ROOT)/$(RELEASE_MODE).mk GOPATH := $(GOBUILDDIR) -GOVERSION := 1.10.0-alpine +GOVERSION := 1.17-alpine3.15 +DISTRIBUTION := alpine:3.15 PULSAR := $(GOBUILDDIR)/bin/pulsar$(shell go env GOEXE) GOASSETSBUILDER := $(GOBUILDDIR)/bin/go-assets-builder$(shell go env GOEXE) @@ -281,9 +282,13 @@ $(BIN): $(VBIN_LINUX_AMD64) .PHONY: docker docker: check-vars $(VBIN_LINUX_AMD64) $(VBIN_LINUX_ARM64) ifdef PUSHIMAGES - 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) . + docker buildx build --no-cache -f $(DOCKERFILE) --build-arg GOVERSION=$(GOVERSION) --build-arg DISTRIBUTION=$(DISTRIBUTION) \ + --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" \ + --platform linux/amd64,linux/arm64 --push -t $(OPERATORIMAGE) . else - 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) . + docker buildx build --no-cache -f $(DOCKERFILE) --build-arg GOVERSION=$(GOVERSION) --build-arg DISTRIBUTION=$(DISTRIBUTION) \ + --build-arg "VERSION=${VERSION_MAJOR_MINOR_PATCH}" --build-arg "RELEASE_MODE=$(RELEASE_MODE)" \ + --platform linux/amd64,linux/arm64 -t $(OPERATORIMAGE) . endif .PHONY: docker-ubi @@ -392,7 +397,7 @@ run-unit-tests: $(SOURCES) $(REPOPATH)/pkg/deployment/... \ $(REPOPATH)/pkg/storage \ $(REPOPATH)/pkg/util/... \ - $(REPOPATH)/pkg/backup/... + $(REPOPATH)/pkg/handlers/... # Release building @@ -450,7 +455,7 @@ set-api-version/%: "$(ROOT)/pkg/operator/" \ "$(ROOT)/pkg/server/" \ "$(ROOT)/pkg/util/" \ - "$(ROOT)/pkg/backup/" \ + "$(ROOT)/pkg/handlers/" \ "$(ROOT)/pkg/apis/backup/" \ | cut -d ':' -f 1 | sort | uniq \ | 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/%: "$(ROOT)/pkg/operator/" \ "$(ROOT)/pkg/server/" \ "$(ROOT)/pkg/util/" \ - "$(ROOT)/pkg/backup/" \ + "$(ROOT)/pkg/handlers/" \ "$(ROOT)/pkg/apis/backup/" \ | cut -d ':' -f 1 | sort | uniq \ | xargs -n 1 sed -i "s#DatabaseV[A-Za-z0-9]\+()\.#DatabaseV$(API_VERSION)().#g" @@ -470,7 +475,7 @@ set-api-version/%: "$(ROOT)/pkg/operator/" \ "$(ROOT)/pkg/server/" \ "$(ROOT)/pkg/util/" \ - "$(ROOT)/pkg/backup/" \ + "$(ROOT)/pkg/handlers" \ "$(ROOT)/pkg/apis/backup/" \ | cut -d ':' -f 1 | sort | uniq \ | xargs -n 1 sed -i "s#ReplicationV[A-Za-z0-9]\+()\.#ReplicationV$(API_VERSION)().#g" diff --git a/go.mod b/go.mod index 1fd393c12..fdf7ddb3f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/arangodb/kube-arangodb -go 1.16 +go 1.17 replace ( github.com/arangodb/go-driver => github.com/arangodb/go-driver v1.2.1 @@ -31,22 +31,12 @@ require ( //github.com/arangodb/rebalancer v0.1.1 github.com/cenkalti/backoff v2.2.1+incompatible github.com/dchest/uniuri v0.0.0-20160212164326-8902c56451e9 - github.com/evanphx/json-patch v4.9.0+incompatible // indirect github.com/ghodss/yaml v1.0.0 github.com/gin-gonic/gin v1.7.2 - github.com/go-playground/validator/v10 v10.8.0 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible - github.com/golang/protobuf v1.5.2 // indirect - github.com/google/addlicense v0.0.0-20210428195630-6d92264d7170 // indirect - github.com/hashicorp/golang-lru v0.5.3 // indirect github.com/jessevdk/go-assets v0.0.0-20160921144138-4f4301a06e15 - github.com/jessevdk/go-assets-builder v0.0.0-20130903091706-b8483521738f // indirect - github.com/jessevdk/go-flags v1.5.0 // indirect - github.com/json-iterator/go v1.1.11 // indirect github.com/julienschmidt/httprouter v1.3.0 github.com/magiconair/properties v1.8.5 - github.com/mattn/go-isatty v0.0.13 // indirect - github.com/onsi/gomega v1.7.1 // indirect github.com/pkg/errors v0.9.1 github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.44.1 github.com/prometheus-operator/prometheus-operator/pkg/client v0.0.0-00010101000000-000000000000 @@ -57,15 +47,65 @@ require ( github.com/spf13/cobra v1.2.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.7.0 - github.com/ugorji/go/codec v1.2.6 // indirect - golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c - golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect - google.golang.org/protobuf v1.27.1 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect k8s.io/api v0.19.8 k8s.io/apiextensions-apiserver v0.18.3 k8s.io/apimachinery v0.19.8 k8s.io/client-go v12.0.0+incompatible k8s.io/klog v1.0.0 ) + +require ( + github.com/arangodb/go-velocypack v0.0.0-20200318135517-5af53c29c67e // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/evanphx/json-patch v4.9.0+incompatible // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-logr/logr v0.2.0 // indirect + github.com/go-playground/locales v0.13.0 // indirect + github.com/go-playground/universal-translator v0.17.0 // indirect + github.com/go-playground/validator/v10 v10.8.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/google/addlicense v0.0.0-20210428195630-6d92264d7170 // indirect + github.com/google/go-cmp v0.5.5 // indirect + github.com/google/gofuzz v1.1.0 // indirect + github.com/google/uuid v1.1.2 // indirect + github.com/googleapis/gnostic v0.4.1 // indirect + github.com/hashicorp/golang-lru v0.5.3 // indirect + github.com/imdario/mergo v0.3.5 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/jessevdk/go-assets-builder v0.0.0-20130903091706-b8483521738f // indirect + github.com/jessevdk/go-flags v1.5.0 // indirect + github.com/json-iterator/go v1.1.11 // indirect + github.com/leodido/go-urn v1.2.1 // indirect + github.com/mattn/go-isatty v0.0.13 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/onsi/gomega v1.7.1 // indirect + github.com/pavel-v-chernykh/keystore-go v2.1.0+incompatible // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/common v0.10.0 // indirect + github.com/prometheus/procfs v0.1.3 // indirect + github.com/stretchr/objx v0.2.0 // indirect + github.com/ugorji/go/codec v1.2.6 // indirect + golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 // indirect + golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect + golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602 // indirect + golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect + golang.org/x/text v0.3.6 // indirect + golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/protobuf v1.27.1 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + k8s.io/klog/v2 v2.2.0 // indirect + k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6 // indirect + k8s.io/utils v0.0.0-20200729134348-d5654de09c73 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.0.1 // indirect + sigs.k8s.io/yaml v1.2.0 // indirect +) diff --git a/pkg/deployment/members.community.go b/pkg/deployment/members.community.go index e93f84cb7..51a38d2a5 100644 --- a/pkg/deployment/members.community.go +++ b/pkg/deployment/members.community.go @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // +//go:build !enterprise // +build !enterprise package deployment diff --git a/pkg/deployment/pod/topology.community.go b/pkg/deployment/pod/topology.community.go index 43eecb145..cd2099834 100644 --- a/pkg/deployment/pod/topology.community.go +++ b/pkg/deployment/pod/topology.community.go @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // +//go:build !enterprise // +build !enterprise package pod diff --git a/pkg/deployment/reconcile/action_topology_disable.community.go b/pkg/deployment/reconcile/action_topology_disable.community.go index 32d431941..c8f70b2e2 100644 --- a/pkg/deployment/reconcile/action_topology_disable.community.go +++ b/pkg/deployment/reconcile/action_topology_disable.community.go @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // +//go:build !enterprise // +build !enterprise package reconcile diff --git a/pkg/deployment/reconcile/action_topology_enable.community.go b/pkg/deployment/reconcile/action_topology_enable.community.go index cb2a91e28..63aafd1fe 100644 --- a/pkg/deployment/reconcile/action_topology_enable.community.go +++ b/pkg/deployment/reconcile/action_topology_enable.community.go @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // +//go:build !enterprise // +build !enterprise package reconcile diff --git a/pkg/deployment/reconcile/action_topology_member_assignment.community.go b/pkg/deployment/reconcile/action_topology_member_assignment.community.go index a1152b1b3..5222a8b31 100644 --- a/pkg/deployment/reconcile/action_topology_member_assignment.community.go +++ b/pkg/deployment/reconcile/action_topology_member_assignment.community.go @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // +//go:build !enterprise // +build !enterprise package reconcile diff --git a/pkg/deployment/reconcile/action_topology_zones_update.community.go b/pkg/deployment/reconcile/action_topology_zones_update.community.go index 7c4bfd52e..dbe1248e3 100644 --- a/pkg/deployment/reconcile/action_topology_zones_update.community.go +++ b/pkg/deployment/reconcile/action_topology_zones_update.community.go @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // +//go:build !enterprise // +build !enterprise package reconcile diff --git a/pkg/deployment/reconcile/plan_builder_rebalancer.community.go b/pkg/deployment/reconcile/plan_builder_rebalancer.community.go index aad7b1276..e1f3ec21b 100644 --- a/pkg/deployment/reconcile/plan_builder_rebalancer.community.go +++ b/pkg/deployment/reconcile/plan_builder_rebalancer.community.go @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // +//go:build !enterprise // +build !enterprise package reconcile diff --git a/pkg/deployment/reconcile/plan_builder_topology.community.go b/pkg/deployment/reconcile/plan_builder_topology.community.go index 9d8a68b96..f4caa6dac 100644 --- a/pkg/deployment/reconcile/plan_builder_topology.community.go +++ b/pkg/deployment/reconcile/plan_builder_topology.community.go @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // +//go:build !enterprise // +build !enterprise package reconcile diff --git a/pkg/deployment/topology/mods.community.go b/pkg/deployment/topology/mods.community.go index fbdf4855f..a3d788db5 100644 --- a/pkg/deployment/topology/mods.community.go +++ b/pkg/deployment/topology/mods.community.go @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // +//go:build !enterprise // +build !enterprise package topology diff --git a/pkg/deployment/topology/topology.community.go b/pkg/deployment/topology/topology.community.go index c374726f7..22f2352a8 100644 --- a/pkg/deployment/topology/topology.community.go +++ b/pkg/deployment/topology/topology.community.go @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // +//go:build !enterprise // +build !enterprise package topology diff --git a/pkg/version/version.community.go b/pkg/version/version.community.go index 7af025620..fc3c73f12 100644 --- a/pkg/version/version.community.go +++ b/pkg/version/version.community.go @@ -18,6 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // +//go:build !enterprise // +build !enterprise package version