Skip to content

Commit

Permalink
Update to go 1.18 (#209)
Browse files Browse the repository at this point in the history
* updateToGo1.18

Signed-off-by: Sherin Varughese <shvarugh@redhat.com>

* update packages

Signed-off-by: Sherin Varughese <shvarugh@redhat.com>

* update replace

Signed-off-by: Sherin Varughese <shvarugh@redhat.com>

* update make lint

Signed-off-by: Sherin Varughese <shvarugh@redhat.com>
  • Loading branch information
SherinV authored Jul 19, 2022
1 parent 33bc7b0 commit 92e581e
Show file tree
Hide file tree
Showing 7 changed files with 333 additions and 802 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Cluster Management project

FROM registry.ci.openshift.org/stolostron/builder:go1.17-linux AS builder
FROM registry.ci.openshift.org/stolostron/builder:go1.18-linux AS builder

WORKDIR /go/src/github.com/stolostron/search-collector
COPY . .
Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ build-linux:

.PHONY: lint
lint:
go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.38.0
# Flag GOGC=25 needed to run garbage collection more often and avoid out of memory issue.
GOGC=25 golangci-lint run --timeout=3m
build/run-lint-check.sh

run:
GOGC=25 go run main.go --v=2
Expand Down
4 changes: 1 addition & 3 deletions Makefile.prow
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ build:

.PHONY: lint
lint:
go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.38.0
# Flag GOGC=25 needed to run garbage collection more often and avoid out of memory issue.
GOGC=25 golangci-lint run --timeout=3m
build/run-lint-check.sh

.PHONY: unit-test
unit-test:
Expand Down
16 changes: 16 additions & 0 deletions build/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
service:
# When updating this, also update the version stored in docker/build-tools/Dockerfile in the multicloudlab/tools repo.
golangci-lint-version: 1.47.1 # use the fixed version to not introduce new linters unexpectedly
run:
# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 20m
timeout: 20m
go: 1.17
# which dirs to skip: they won't be analyzed;
# can use regexp here: generated.*, regexp is applied on full path;
# default value is empty list, but next dirs are always skipped independently
# from this option's value:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs:
- test-data
- vbh
8 changes: 8 additions & 0 deletions build/run-lint-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
GOLANGCI_LINT_VERSION="v1.47.1"
GOLANGCI_LINT_CACHE=/tmp/golangci-cache
GOPATH=$(go env GOPATH)
export GOFLAGS=""
DOWNLOAD_URL="https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh"
curl -sSfL "${DOWNLOAD_URL}" | sh -s -- -b "${GOPATH}/bin" v1.47.1
$(GOLANGCI_LINT_CACHE=${GOLANGCI_LINT_CACHE} CGO_ENABLED=0 GOGC=25 golangci-lint run)
81 changes: 40 additions & 41 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,73 +3,72 @@

module github.com/stolostron/search-collector

go 1.17
go 1.18

require (
github.com/golang/glog v1.0.0
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
github.com/kennygrant/sanitize v1.2.4
github.com/openshift/api v3.9.1-0.20190924102528-32369d4db2ad+incompatible
github.com/stolostron/governance-policy-propagator v0.0.0-20220125192743-95d49290a318
github.com/stolostron/multicloud-operators-deployable v1.2.4-0-20220114-a630015d
github.com/stolostron/multicloud-operators-placementrule v1.2.4-0-20220112-8eedb3f
github.com/stolostron/multicloud-operators-deployable v1.2.4-1-20220201-2d1add0
github.com/stolostron/multicloud-operators-placementrule v1.2.4-1-20220311-8eedb3f
github.com/stretchr/testify v1.7.0
github.com/tkanos/gonfig v0.0.0-20210106201359-53e13348de2f
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.21.3
k8s.io/apimachinery v0.21.3
k8s.io/api v0.24.3
k8s.io/apimachinery v0.24.3
k8s.io/client-go v13.0.0+incompatible
k8s.io/helm v2.16.7+incompatible
k8s.io/klog/v2 v2.9.0 // indirect
k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9 // indirect
open-cluster-management.io/multicloud-operators-channel v0.5.1-0.20211122200432-da1610291798
open-cluster-management.io/multicloud-operators-subscription v0.6.0 //Use 2.0 when available
k8s.io/helm v2.17.0+incompatible
k8s.io/klog/v2 v2.70.1 // indirect
k8s.io/utils v0.0.0-20220713171938-56c0de1e6f5e // indirect
open-cluster-management.io/multicloud-operators-channel v0.8.0
open-cluster-management.io/multicloud-operators-subscription v0.8.0 //Use 2.0 when available
sigs.k8s.io/application v0.8.3
)

require (
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful v2.11.1+incompatible // indirect
github.com/evanphx/json-patch v4.11.0+incompatible // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 // indirect
github.com/go-logr/logr v0.4.0 // indirect
github.com/go-openapi/jsonpointer v0.19.3 // indirect
github.com/go-openapi/jsonreference v0.19.3 // indirect
github.com/go-openapi/spec v0.19.5 // indirect
github.com/go-openapi/swag v0.19.5 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/json-iterator/go v1.1.11 // indirect
github.com/kr/pretty v0.2.1 // indirect
github.com/mailru/easyjson v0.7.0 // indirect
github.com/google/gnostic v0.6.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/open-cluster-management/multicloud-operators-placementrule v1.2.4-0-20211122-be034 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/net v0.0.0-20220708220712-1185a9018129 // indirect
golang.org/x/oauth2 v0.0.0-20220718184931-c8730f7fcb92 // indirect
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.27.1 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 // indirect
sigs.k8s.io/controller-runtime v0.9.2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/kube-openapi v0.0.0-20220627174259-011e075b9cb8 // indirect
sigs.k8s.io/controller-runtime v0.12.3 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace (
golang.org/x/crypto => golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4
k8s.io/client-go => k8s.io/client-go v0.21.1
golang.org/x/crypto => golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d
k8s.io/client-go => k8s.io/client-go v0.24.3
)
Loading

0 comments on commit 92e581e

Please sign in to comment.