From 24569a0d512795931e035d3fc0169a025b705fc8 Mon Sep 17 00:00:00 2001 From: Edvin N Date: Mon, 30 May 2022 12:01:52 +0200 Subject: [PATCH] [chore] update golang to 1.18 (#768) * Update golang to 1.18 * go mod tidy * update deepcopy after golang version update * go get is depricated in 1.18, use go install * update kustomize version to 4.5.2 in makefile --- .github/workflows/kind-e2e.yaml | 2 +- .github/workflows/pr-validation.yaml | 12 ++-- .github/workflows/release.yaml | 4 +- .golangci.yaml | 6 +- Dockerfile | 2 +- Makefile | 10 +-- .../v1alpha1/zz_generated.deepcopy.go | 1 + go.mod | 61 ++++++++++++++++++- go.sum | 2 - 9 files changed, 79 insertions(+), 21 deletions(-) diff --git a/.github/workflows/kind-e2e.yaml b/.github/workflows/kind-e2e.yaml index 7762269e2..b6ce96c0b 100644 --- a/.github/workflows/kind-e2e.yaml +++ b/.github/workflows/kind-e2e.yaml @@ -21,7 +21,7 @@ jobs: - name: Setup go uses: actions/setup-go@v2 with: - go-version: "^1.16.2" + go-version: "^1.18.2" - name: Prepare id: prep shell: bash diff --git a/.github/workflows/pr-validation.yaml b/.github/workflows/pr-validation.yaml index e524ef92c..de8ccf8d3 100644 --- a/.github/workflows/pr-validation.yaml +++ b/.github/workflows/pr-validation.yaml @@ -16,7 +16,7 @@ jobs: - name: Setup go uses: actions/setup-go@v2 with: - go-version: "1.16" + go-version: "1.18" - name: golangci-lint uses: golangci/golangci-lint-action@v2.5.2 with: @@ -31,7 +31,7 @@ jobs: - name: Setup go uses: actions/setup-go@v2 with: - go-version: "1.16" + go-version: "1.18" - name: Run fmt run: | make fmt @@ -51,7 +51,7 @@ jobs: - name: Setup go uses: actions/setup-go@v2 with: - go-version: "1.16" + go-version: "1.18" - name: Run manifests run: | make manifests @@ -71,7 +71,7 @@ jobs: - name: Setup go uses: actions/setup-go@v2 with: - go-version: "1.16" + go-version: "1.18" - name: Run api-docs run: | make api-docs @@ -91,7 +91,7 @@ jobs: - name: Setup go uses: actions/setup-go@v2 with: - go-version: "1.16" + go-version: "1.18" - name: Run test shell: bash run: | @@ -141,7 +141,7 @@ jobs: - name: Setup go uses: actions/setup-go@v2 with: - go-version: "1.16" + go-version: "1.18" - name: Prepare id: prep run: | diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 19eb4a598..3cabcce21 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,7 +3,7 @@ name: Release container on: push: tags: - - '*' + - "*" jobs: container-images: @@ -21,7 +21,7 @@ jobs: - name: Setup go uses: actions/setup-go@v2 with: - go-version: "1.16" + go-version: "1.18" - name: Prepare id: prep run: | diff --git a/.golangci.yaml b/.golangci.yaml index 12f8fd5aa..b70dc3ac8 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -38,7 +38,7 @@ linters-settings: locale: US unused: - go: "1.16" + go: "1.18" unparam: check-exported: true @@ -47,7 +47,7 @@ linters-settings: check-shadowing: false gosimple: - go: "1.16" + go: "1.18" checks: ["all"] errorlint: @@ -108,7 +108,7 @@ linters-settings: require-specific: false staticcheck: - go: "1.16" + go: "1.18" checks: ["all"] thelper: diff --git a/Dockerfile b/Dockerfile index edffa053a..2e288c34b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG BUILDER_IMAGE=golang:1.16 +ARG BUILDER_IMAGE=golang:1.18 ARG UBI_MINIMAL_IMAGE=registry.access.redhat.com/ubi8/ubi-minimal:8.5 ARG UBI_MICRO_IMAGE=registry.access.redhat.com/ubi8/ubi-micro:8.5 diff --git a/Makefile b/Makefile index abc29b0a8..326b9cf69 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # Current Operator version -VERSION ?= 4.4.1 +VERSION ?= test # IMAGE_TAG_BASE defines the namespace and part of the image name for remote images. # running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both @@ -124,9 +124,9 @@ controller-gen: # Download kustomize locally if necessary KUSTOMIZE = $(shell pwd)/bin/kustomize kustomize: - $(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v3@v3.8.7) + $(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v4@v4.5.2) -# go-get-tool will 'go get' any package $2 and install it to $1. +# go-get-tool will 'go install' any package $2 and install it to $1. PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) define go-get-tool @[ -f $(1) ] || { \ @@ -135,7 +135,7 @@ TMP_DIR=$$(mktemp -d) ;\ cd $$TMP_DIR ;\ go mod init tmp ;\ echo "Downloading $(2)" ;\ -GOBIN=$(PROJECT_DIR)/bin go get $(2) ;\ +GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\ rm -rf $$TMP_DIR ;\ } endef @@ -174,7 +174,7 @@ ifeq (, $(shell which crdoc)) API_REF_GEN_TMP_DIR=$$(mktemp -d) ;\ cd $$API_REF_GEN_TMP_DIR ;\ go mod init tmp ;\ - go get fybrik.io/crdoc@v0.5.2 ;\ + go install fybrik.io/crdoc@v0.5.2 ;\ rm -rf $$API_REF_GEN_TMP_DIR ;\ } API_REF_GEN=$(GOBIN)/crdoc diff --git a/api/integreatly/v1alpha1/zz_generated.deepcopy.go b/api/integreatly/v1alpha1/zz_generated.deepcopy.go index 10b78df33..d07f415f1 100644 --- a/api/integreatly/v1alpha1/zz_generated.deepcopy.go +++ b/api/integreatly/v1alpha1/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/go.mod b/go.mod index db43aa7ae..1609d40b9 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/grafana-operator/grafana-operator/v4 -go 1.16 +go 1.18 require ( github.com/blang/semver v3.5.1+incompatible @@ -17,6 +17,65 @@ require ( sigs.k8s.io/controller-runtime v0.8.3 ) +require ( + cloud.google.com/go v0.54.0 // indirect + github.com/Azure/go-autorest v14.2.0+incompatible // indirect + github.com/Azure/go-autorest/autorest v0.11.1 // indirect + github.com/Azure/go-autorest/autorest/adal v0.9.5 // indirect + github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect + github.com/Azure/go-autorest/logger v0.2.0 // indirect + github.com/Azure/go-autorest/tracing v0.6.0 // 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/form3tech-oss/jwt-go v3.2.2+incompatible // indirect + github.com/fsnotify/fsnotify v1.4.9 // indirect + github.com/go-logr/zapr v0.2.0 // indirect + github.com/gogo/protobuf v1.3.1 // indirect + github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect + github.com/golang/protobuf v1.4.3 // indirect + github.com/google/go-cmp v0.5.2 // indirect + github.com/google/gofuzz v1.1.0 // indirect + github.com/google/uuid v1.1.2 // indirect + github.com/googleapis/gnostic v0.5.1 // indirect + github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/imdario/mergo v0.3.10 // indirect + github.com/json-iterator/go v1.1.10 // 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/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.7.1 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.10.0 // indirect + github.com/prometheus/procfs v0.2.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + go.uber.org/atomic v1.6.0 // indirect + go.uber.org/multierr v1.5.0 // indirect + go.uber.org/zap v1.15.0 // indirect + golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 // indirect + golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect + golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect + golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // 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-20200630173020-3af7569d3a1e // indirect + gomodules.xyz/jsonpatch/v2 v2.1.0 // indirect + google.golang.org/appengine v1.6.6 // indirect + google.golang.org/protobuf v1.25.0 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v2 v2.3.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect + k8s.io/apiextensions-apiserver v0.20.1 // indirect + k8s.io/component-base v0.20.2 // indirect + k8s.io/klog/v2 v2.4.0 // indirect + k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd // indirect + k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.0.2 // indirect + sigs.k8s.io/yaml v1.2.0 // indirect +) + replace github.com/gogo/protobuf v1.3.1 => github.com/gogo/protobuf v1.3.2 // Handle CVE-2022-27191 diff --git a/go.sum b/go.sum index a2262e5b0..36c62c275 100644 --- a/go.sum +++ b/go.sum @@ -80,7 +80,6 @@ github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdn github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -855,7 +854,6 @@ k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8 k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=