Skip to content

Commit

Permalink
Upgrade go version to 1.20 (#1005)
Browse files Browse the repository at this point in the history
  • Loading branch information
kovayur authored May 5, 2023
1 parent 61b65b7 commit 3439058
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ jobs:
uses: n1hility/cancel-previous-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v2
with:
go-version: "1.19"
go-version: "1.20"
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Cache go module
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy-data-plane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ jobs:
contents: read
environment: ${{ inputs.github_environment }}
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: "1.19"
go-version: "1.20"
- name: Checkout
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -81,10 +81,10 @@ jobs:
contents: read
environment: ${{ inputs.github_environment }}
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: "1.19"
go-version: "1.20"
- name: Checkout
uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/setup-python@v3
- uses: actions/setup-go@v3
with:
go-version: "1.19"
go-version: "1.20"
- uses: pre-commit/[email protected]
- uses: pre-commit/[email protected]
name: Verify generated files are up-to-date
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/probe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
uses: n1hility/cancel-previous-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v2
with:
go-version: "1.19"
go-version: "1.20"
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Cache go module
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
contents: read
environment: development
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v2
with:
go-version: "1.19"
go-version: "1.20"
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Cache go module
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ linters-settings:
require-explanation: false # don't require an explanation for nolint directives
require-specific: true # require nolint directives to be specific about which linter is being skipped
staticcheck:
go: "1.19"
go: "1.20"
checks: [ all,-ST1000,-ST1001,-ST1003,-ST1005,-SA1019,-SA4001,-ST1016 ]
wrapcheck:
# ignoreSigRegexps: uncomment to add ignore rules
Expand Down
2 changes: 1 addition & 1 deletion .openshift-ci/e2e-runtime/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

RUN dnf update -y --disablerepo=\* --enablerepo=baseos,appstream && dnf -y install make which git gettext jq gcc && dnf clean all && rm -rf /var/cache/dnf

COPY --from=registry.ci.openshift.org/openshift/release:golang-1.19 /usr/local/go /usr/local/go
COPY --from=registry.ci.openshift.org/stolostron/builder:go1.20-linux /usr/local/go /usr/local/go
COPY --from=quay.io/openshift/origin-cli:4.13 /usr/bin/oc /usr/bin
COPY --from=quay.io/operator-framework/operator-sdk:v1.25 /usr/local/bin/operator-sdk /usr/local/bin

Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ repos:
- id: detect-secrets
args: ["--baseline", ".secrets.baseline"]
- repo: https://github.com/golangci/golangci-lint
rev: v1.51.1
rev: v1.52.2
hooks:
- id: golangci-lint
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
args: ["--markdown-linebreak-ext=md"]
- id: end-of-file-fixer
exclude: '^(?:secrets/db.*|internal/dinosaur/pkg/api/(admin|private|public)/.*|pkg/client/redhatsso/api/.*)$' # Matches either secrets/db.* files or the generated files under internal/dinosaur/pkg/api/(admin|private|public) and pkg/client/redhatsso/client/api.
- id: check-json
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.8.0.4
rev: v0.9.0.2
hooks:
- id: shellcheck
# Ignore scripts generated by openapi-generator.
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.ci.openshift.org/openshift/release:golang-1.19 AS build
FROM registry.ci.openshift.org/stolostron/builder:go1.20-linux AS build

ENV GOFLAGS="-mod=mod"

Expand Down
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,6 @@ test/rds: $(GOTESTSUM_BIN)
./fleetshard/pkg/central/cloudprovider/awsclient/...
.PHONY: test/rds

# Precompile everything required for development/test.
test/prepare:
$(GO) test -i ./internal/dinosaur/test/integration/...
.PHONY: test/prepare

# Runs the integration tests.
#
# Args:
Expand All @@ -345,7 +340,7 @@ test/prepare:
# make test/integration TESTFLAGS="-run TestAccounts" acts as TestAccounts* and run TestAccountsGet, TestAccountsPost, etc.
# make test/integration TESTFLAGS="-run TestAccountsGet" runs TestAccountsGet
# make test/integration TESTFLAGS="-short" skips long-run tests
test/integration/dinosaur: test/prepare $(GOTESTSUM_BIN)
test/integration/dinosaur: $(GOTESTSUM_BIN)
$(GOTESTSUM_BIN) --junitfile data/results/fleet-manager-integration-tests.xml --format $(GOTESTSUM_FORMAT) -- -p 1 -ldflags -s -v -timeout $(TEST_TIMEOUT) -count=1 $(TESTFLAGS) \
./internal/dinosaur/test/integration/...
.PHONY: test/integration/dinosaur
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ACS fleet-manager repository for the ACS managed service.

#### Prerequisites

* [Golang 1.19+](https://golang.org/dl/)
* [Golang 1.20+](https://golang.org/dl/)
* [Docker](https://docs.docker.com/get-docker/) - to create database
* [ocm cli](https://github.com/openshift-online/ocm-cli/releases) - ocm command line tool
* [Node.js v12.20+](https://nodejs.org/en/download/) and [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
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 github.com/stackrox/acs-fleet-manager

go 1.19
go 1.20

require (
github.com/DATA-DOG/go-sqlmock v1.5.0
Expand Down
3 changes: 3 additions & 0 deletions internal/dinosaur/pkg/services/data_migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ func (m *DataMigration) migrateOrganisationNames() (int, error) {
glog.Infof("migrated column %q to new value %q for central instance %q ", colName, central.OrganisationName, central.ID)
migratedCnt++
}
if err := rows.Err(); err != nil {
glog.Error(errors.Wrapf(err, "iterating %q rows", colName))
}
return migratedCnt, nil
}

Expand Down
2 changes: 1 addition & 1 deletion probe/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.ci.openshift.org/openshift/release:golang-1.19 AS build
FROM registry.ci.openshift.org/stolostron/builder:go1.20-linux AS build

ENV GOFLAGS="-mod=mod"

Expand Down
2 changes: 1 addition & 1 deletion tools/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/stackrox/acs-fleet-manager/tools

go 1.19
go 1.20

require (
github.com/99designs/aws-vault/v6 v6.6.2
Expand Down

0 comments on commit 3439058

Please sign in to comment.