diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3176c4e32..9c43720eb 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -25,7 +25,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2 with: - go-version: 1.16.x + go-version: 1.17.x - name: Download modules run: | go mod download diff --git a/Dockerfile b/Dockerfile index 9564c8cac..3e1324577 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.16-alpine as builder +FROM golang:1.17-alpine as builder ARG TARGETPLATFORM ARG REVISON diff --git a/Makefile b/Makefile index 6b7dbeda1..a1b1bf25e 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ build: CGO_ENABLED=0 go build -a -o ./bin/flagger ./cmd/flagger fmt: + go mod tidy gofmt -l -s -w ./ goimports -l -w ./ diff --git a/docs/gitbook/dev/dev-guide.md b/docs/gitbook/dev/dev-guide.md index 5b08ee0d2..527845178 100644 --- a/docs/gitbook/dev/dev-guide.md +++ b/docs/gitbook/dev/dev-guide.md @@ -8,17 +8,17 @@ Flagger is written in Go and uses Go modules for dependency management. On your dev machine install the following tools: -* go >= 1.14 -* git >= 2.20 -* bash >= 5.0 -* make >= 3.81 -* kubectl >= 1.16 -* kustomize >= 3.5 -* helm >= 3.0 -* docker >= 19.03 +* go >= 1.17 +* git >;= 2.20 +* bash >= 5.0 +* make >= 3.81 +* kubectl >= 1.22 +* kustomize >= 4.4 +* helm >= 3.0 +* docker >= 19.03 You'll also need a Kubernetes cluster for testing Flagger. -You can use Minikube, Kind, Docker desktop or any remote cluster (AKS/EKS/GKE/etc) Kubernetes version 1.16 or newer. +You can use Minikube, Kind, Docker desktop or any remote cluster (AKS/EKS/GKE/etc) Kubernetes version 1.22 or newer. To start contributing to Flagger, fork the [repository](https://github.com/fluxcd/flagger) on GitHub. @@ -100,6 +100,8 @@ make codegen Run code formatters: ```bash +go install golang.org/x/tools/cmd/goimports@latest + make fmt ``` diff --git a/go.mod b/go.mod index 5b39ae633..cfca58f77 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/fluxcd/flagger -go 1.16 +go 1.17 require ( cloud.google.com/go/monitoring v0.1.0 @@ -25,3 +25,54 @@ require ( k8s.io/code-generator v0.21.1 k8s.io/klog/v2 v2.8.0 ) + +require ( + cloud.google.com/go v0.92.3 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/deepmap/oapi-codegen v1.8.2 // indirect + github.com/evanphx/json-patch v4.9.0+incompatible // indirect + github.com/go-logr/logr v0.4.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/gofuzz v1.1.0 // indirect + github.com/google/uuid v1.1.2 // indirect + github.com/googleapis/gnostic v0.4.1 // indirect + github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect + github.com/hashicorp/golang-lru v0.5.1 // indirect + github.com/imdario/mergo v0.3.5 // indirect + github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect + github.com/json-iterator/go v1.1.11 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.26.0 // indirect + github.com/prometheus/procfs v0.6.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + go.opencensus.io v0.23.0 // indirect + go.uber.org/atomic v1.6.0 // indirect + go.uber.org/multierr v1.5.0 // indirect + golang.org/x/mod v0.4.2 // indirect + golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420 // indirect + golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a // indirect + golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 // indirect + golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect + golang.org/x/text v0.3.6 // indirect + golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect + golang.org/x/tools v0.1.5 // indirect + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect + google.golang.org/appengine v1.6.7 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect + k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027 // indirect + k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 // indirect + k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.1.0 // indirect + sigs.k8s.io/yaml v1.2.0 // indirect +) diff --git a/pkg/apis/appmesh/v1beta1/zz_generated.deepcopy.go b/pkg/apis/appmesh/v1beta1/zz_generated.deepcopy.go index f81f6a26c..01960a275 100644 --- a/pkg/apis/appmesh/v1beta1/zz_generated.deepcopy.go +++ b/pkg/apis/appmesh/v1beta1/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/pkg/apis/appmesh/v1beta2/zz_generated.deepcopy.go b/pkg/apis/appmesh/v1beta2/zz_generated.deepcopy.go index 34a62c700..fe113cdc0 100644 --- a/pkg/apis/appmesh/v1beta2/zz_generated.deepcopy.go +++ b/pkg/apis/appmesh/v1beta2/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/pkg/apis/flagger/v1beta1/zz_generated.deepcopy.go b/pkg/apis/flagger/v1beta1/zz_generated.deepcopy.go index 8bd1a4c30..1481bf7b3 100644 --- a/pkg/apis/flagger/v1beta1/zz_generated.deepcopy.go +++ b/pkg/apis/flagger/v1beta1/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/pkg/apis/gloo/gateway/v1/zz_generated.deepcopy.go b/pkg/apis/gloo/gateway/v1/zz_generated.deepcopy.go index 44a00d9a7..d94f73bcc 100644 --- a/pkg/apis/gloo/gateway/v1/zz_generated.deepcopy.go +++ b/pkg/apis/gloo/gateway/v1/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/pkg/apis/gloo/gloo/v1/zz_generated.deepcopy.go b/pkg/apis/gloo/gloo/v1/zz_generated.deepcopy.go index 0b305b255..3e0748424 100644 --- a/pkg/apis/gloo/gloo/v1/zz_generated.deepcopy.go +++ b/pkg/apis/gloo/gloo/v1/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go b/pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go index c2061a686..6a6fcfc50 100644 --- a/pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go +++ b/pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/pkg/apis/projectcontour/v1/zz_generated.deepcopy.go b/pkg/apis/projectcontour/v1/zz_generated.deepcopy.go index 967601b7e..be2d9f8d6 100644 --- a/pkg/apis/projectcontour/v1/zz_generated.deepcopy.go +++ b/pkg/apis/projectcontour/v1/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/pkg/apis/smi/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/smi/v1alpha1/zz_generated.deepcopy.go index 0013d998b..a4755d945 100644 --- a/pkg/apis/smi/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/smi/v1alpha1/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/pkg/apis/smi/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/smi/v1alpha2/zz_generated.deepcopy.go index e07e59942..465a5e997 100644 --- a/pkg/apis/smi/v1alpha2/zz_generated.deepcopy.go +++ b/pkg/apis/smi/v1alpha2/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/pkg/apis/smi/v1alpha3/zz_generated.deepcopy.go b/pkg/apis/smi/v1alpha3/zz_generated.deepcopy.go index 0a1807ec9..9cc8de73e 100644 --- a/pkg/apis/smi/v1alpha3/zz_generated.deepcopy.go +++ b/pkg/apis/smi/v1alpha3/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/pkg/apis/traefik/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/traefik/v1alpha1/zz_generated.deepcopy.go index 958cca34d..948f2ea64 100644 --- a/pkg/apis/traefik/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/traefik/v1alpha1/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/pkg/signals/signal_posix.go b/pkg/signals/signal_posix.go index 81fe1739c..92d35eccc 100644 --- a/pkg/signals/signal_posix.go +++ b/pkg/signals/signal_posix.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows /*