Skip to content

Commit

Permalink
Merge pull request #209 from open-cluster-management-io/update-go-18
Browse files Browse the repository at this point in the history
update go to 1.18
  • Loading branch information
philipwu08 authored Jul 10, 2022
2 parents 566f21d + 7c59069 commit 82ac6c6
Show file tree
Hide file tree
Showing 39 changed files with 233 additions and 646 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go-postsubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
# Common versions
GO_VERSION: '1.17'
GO_VERSION: '1.18'
GO_REQUIRED_MIN_VERSION: ''
GOPATH: '/home/runner/work/multicloud-operators-subscription/multicloud-operators-subscription/go'
defaults:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
# Common versions
GO_VERSION: '1.17'
GO_VERSION: '1.18'
GO_REQUIRED_MIN_VERSION: ''
GOPATH: '/home/runner/work/multicloud-operators-subscription/multicloud-operators-subscription/go'
defaults:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'v*.*.*'
env:
# Common versions
GO_VERSION: '1.17'
GO_VERSION: '1.18'
GO_REQUIRED_MIN_VERSION: ''
GOPATH: '/home/runner/work/multicloud-operators-subscription/multicloud-operators-subscription/go'
GITHUB_REF: ${{ github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.ci.openshift.org/stolostron/builder:go1.17-linux AS plugin-builder
FROM registry.ci.openshift.org/stolostron/builder:go1.18-linux AS plugin-builder
ENV POLICY_GENERATOR_TAG=v1.8.0

WORKDIR /policy-generator
Expand Down
2 changes: 1 addition & 1 deletion build/Dockerfile.prow
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.ci.openshift.org/stolostron/builder:go1.17-linux AS builder
FROM registry.ci.openshift.org/stolostron/builder:go1.18-linux AS builder
ENV POLICY_GENERATOR_TAG=v1.8.0

WORKDIR /go/src/github.com/stolostron/multicluster-operators-subscription
Expand Down
2 changes: 1 addition & 1 deletion build/run-code-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ gem install mdl
gem install awesome_bot

# Install golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go env GOPATH)"/bin v1.28.3
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go env GOPATH)"/bin v1.46.2

# Start lint task
make -f Makefile.prow lint-all
6 changes: 3 additions & 3 deletions cmd/appsubsummary/exec/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import (

// Change below variables to serve metrics on different host or port.
var (
metricsHost = "0.0.0.0"
metricsPort int = 8391
operatorMetricsPort int = 8691
metricsHost = "0.0.0.0"
metricsPort = 8391
operatorMetricsPort = 8691
)

// RunManager starts the actual manager.
Expand Down
6 changes: 3 additions & 3 deletions cmd/manager/exec/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ import (

// Change below variables to serve metrics on different host or port.
var (
metricsHost = "0.0.0.0"
metricsPort int = 8381
operatorMetricsPort int = 8684
metricsHost = "0.0.0.0"
metricsPort = 8381
operatorMetricsPort = 8684
)

const (
Expand Down
6 changes: 3 additions & 3 deletions cmd/placementrule/exec/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ import (

// Change below variables to serve metrics on different host or port.
var (
metricsHost = "0.0.0.0"
metricsPort int = 8383
operatorMetricsPort int = 8686
metricsHost = "0.0.0.0"
metricsPort = 8383
operatorMetricsPort = 8686
)

// RunManager starts the actual manager
Expand Down
60 changes: 45 additions & 15 deletions common/config/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
service:
# When updating this, also update the version stored in docker/build-tools/Dockerfile in the multicloudlab/tools repo.
golangci-lint-version: 1.28.x # use the fixed version to not introduce new linters unexpectedly
golangci-lint-version: 1.46.x # 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;
Expand All @@ -29,31 +30,56 @@ run:
linters:
enable-all: true
disable:
- exhaustive
- maligned
- bodyclose
- contextcheck
- cyclop
- depguard
- dupl
- forbidigo
- funlen
- errchkjson
- exhaustive
- exhaustruct
- exhaustivestruct
- forcetypeassert
- gci
- gochecknoglobals
- gochecknoinits
- goconst
- gocritic
- gocyclo
- godot
- goerr113
- gofumpt
- golint
- gomnd
- gomoddirectives
- gosec
- ifshort
- ineffassign
- interfacer
- ireturn
- maintidx
- maligned
- nakedret
- nestif
- nilerr
- nilnil
- nlreturn
- noctx
- nonamedreturns
- paralleltest
- prealloc
- predeclared
- staticcheck
- scopelint
- funlen
- bodyclose

- tagliatelle
- tenv
- testpackage
- stylecheck
- noctx
- gomnd
- goerr113
- godot
- gofumpt
- nestif
- ineffassign
- unused
- thelper
- varnamelen
- wastedassign
- wrapcheck
fast: false

linters-settings:
Expand All @@ -65,6 +91,10 @@ linters-settings:
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: false
nolintlint:
# Disable to ensure that all nolint directives actually have an effect.
# Default: false
allow-unused: true
govet:
# report about shadowed variables
check-shadowing: false
Expand Down
2 changes: 1 addition & 1 deletion common/scripts/lint_go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.28.3
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.46.2

export GOLANGCI_LINT_CACHE=/tmp/golangci-cache
rm -rf $GOLANGCI_LINT_CACHE
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module open-cluster-management.io/multicloud-operators-subscription

go 1.17
go 1.18

require (
github.com/Masterminds/semver/v3 v3.1.1
Expand Down
Loading

0 comments on commit 82ac6c6

Please sign in to comment.