Skip to content

Commit

Permalink
[chore] update golang to 1.18 (#768)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
NissesSenap committed May 30, 2022
1 parent 90455ae commit 24569a0
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/kind-e2e.yaml
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/pr-validation.yaml
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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: |
Expand Down Expand Up @@ -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: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Expand Up @@ -3,7 +3,7 @@ name: Release container
on:
push:
tags:
- '*'
- "*"

jobs:
container-images:
Expand All @@ -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: |
Expand Down
6 changes: 3 additions & 3 deletions .golangci.yaml
Expand Up @@ -38,7 +38,7 @@ linters-settings:
locale: US

unused:
go: "1.16"
go: "1.18"

unparam:
check-exported: true
Expand All @@ -47,7 +47,7 @@ linters-settings:
check-shadowing: false

gosimple:
go: "1.16"
go: "1.18"
checks: ["all"]

errorlint:
Expand Down Expand Up @@ -108,7 +108,7 @@ linters-settings:
require-specific: false

staticcheck:
go: "1.16"
go: "1.18"
checks: ["all"]

thelper:
Expand Down
2 changes: 1 addition & 1 deletion 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

Expand Down
10 changes: 5 additions & 5 deletions 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
Expand Down Expand Up @@ -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) ] || { \
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions api/integreatly/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 60 additions & 1 deletion 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
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down

0 comments on commit 24569a0

Please sign in to comment.