From 49ca309622b914740d6ba92c52602a42c711fb31 Mon Sep 17 00:00:00 2001 From: Travis Nielsen Date: Tue, 26 Jul 2022 15:48:44 -0600 Subject: [PATCH] build: only support go 1.18 with the latest modules The modules are only compatible with go 1.18. Remove support for go 1.17. Signed-off-by: Travis Nielsen --- .github/workflows/build.yml | 5 +++-- .github/workflows/canary-test-config/action.yaml | 2 +- .github/workflows/codegen.yml | 2 +- .github/workflows/crds-gen.yml | 2 +- .github/workflows/daily-nightly-jobs.yml | 2 +- .github/workflows/docs-check.yml | 4 ++++ .github/workflows/golangci-lint.yaml | 2 +- .github/workflows/integration-test-config/action.yaml | 2 +- .github/workflows/mod-check.yml | 2 +- .github/workflows/push-build.yaml | 4 ++-- .github/workflows/rbac-gen.yaml | 2 +- .github/workflows/unit-test.yml | 2 +- Documentation/Contributing/development-flow.md | 2 +- build/makelib/golang.mk | 11 ++++++----- 14 files changed, 25 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 076091290..0634d8ad0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 - name: copy working directory to GOPATH run: sudo mkdir -p /Users/runner/go/src/github.com && sudo cp -a /Users/runner/work/rook /Users/runner/go/src/github.com/ @@ -90,7 +90,8 @@ jobs: strategy: fail-fast: false matrix: - go-version: ["1.17", "1.18"] + # Add go 1.19 when available + go-version: ["1.18"] #, "1.19"] steps: - name: checkout uses: actions/checkout@v2 diff --git a/.github/workflows/canary-test-config/action.yaml b/.github/workflows/canary-test-config/action.yaml index 74a027c35..128576133 100644 --- a/.github/workflows/canary-test-config/action.yaml +++ b/.github/workflows/canary-test-config/action.yaml @@ -11,7 +11,7 @@ runs: - name: setup golang uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 - name: setup minikube uses: manusa/actions-setup-minikube@v2.6.0 diff --git a/.github/workflows/codegen.yml b/.github/workflows/codegen.yml index 8ea411f32..1dcc9a9c9 100644 --- a/.github/workflows/codegen.yml +++ b/.github/workflows/codegen.yml @@ -31,7 +31,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 - name: checkout uses: actions/checkout@v2 diff --git a/.github/workflows/crds-gen.yml b/.github/workflows/crds-gen.yml index af16d7672..1f86966b8 100644 --- a/.github/workflows/crds-gen.yml +++ b/.github/workflows/crds-gen.yml @@ -30,7 +30,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 - name: checkout uses: actions/checkout@v2 diff --git a/.github/workflows/daily-nightly-jobs.yml b/.github/workflows/daily-nightly-jobs.yml index 2d1705540..c200236f7 100644 --- a/.github/workflows/daily-nightly-jobs.yml +++ b/.github/workflows/daily-nightly-jobs.yml @@ -24,7 +24,7 @@ jobs: - name: setup golang uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 - name: teardown minikube and docker run: | diff --git a/.github/workflows/docs-check.yml b/.github/workflows/docs-check.yml index 8df1a31d6..4a07da25b 100644 --- a/.github/workflows/docs-check.yml +++ b/.github/workflows/docs-check.yml @@ -25,6 +25,10 @@ jobs: with: fetch-depth: 0 + - uses: actions/setup-go@v2 + with: + go-version: 1.18 + - uses: actions/setup-python@v2 with: python-version: 3.9 diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml index f1c75bafd..c5601c0a0 100644 --- a/.github/workflows/golangci-lint.yaml +++ b/.github/workflows/golangci-lint.yaml @@ -26,7 +26,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 - uses: actions/checkout@v2 with: fetch-depth: 0 diff --git a/.github/workflows/integration-test-config/action.yaml b/.github/workflows/integration-test-config/action.yaml index 8dc6df9fb..0f4031350 100644 --- a/.github/workflows/integration-test-config/action.yaml +++ b/.github/workflows/integration-test-config/action.yaml @@ -14,7 +14,7 @@ runs: - name: setup golang uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 - name: setup minikube uses: manusa/actions-setup-minikube@v2.6.0 diff --git a/.github/workflows/mod-check.yml b/.github/workflows/mod-check.yml index afdefdc16..3a04ab328 100644 --- a/.github/workflows/mod-check.yml +++ b/.github/workflows/mod-check.yml @@ -35,7 +35,7 @@ jobs: - uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 - name: run mod check run: GOPATH=$(go env GOPATH) make -j $(nproc) mod.check diff --git a/.github/workflows/push-build.yaml b/.github/workflows/push-build.yaml index d75f02037..dde7c9079 100644 --- a/.github/workflows/push-build.yaml +++ b/.github/workflows/push-build.yaml @@ -27,7 +27,7 @@ jobs: - uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 # docker/setup-qemu action installs QEMU static binaries, which are used to run builders for architectures other than the host. - name: set up QEMU @@ -59,7 +59,7 @@ jobs: python3 -m pip install --upgrade pip setuptools wheel sudo apt-get -q update sudo apt-get -q install -y python3-pygit2 - + - name: Configure git user run: | # Use our Rook "service account" diff --git a/.github/workflows/rbac-gen.yaml b/.github/workflows/rbac-gen.yaml index 953c38dd3..64106fbdc 100644 --- a/.github/workflows/rbac-gen.yaml +++ b/.github/workflows/rbac-gen.yaml @@ -30,7 +30,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 - name: checkout uses: actions/checkout@v2 diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 1c93b554c..381af65ed 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -36,7 +36,7 @@ jobs: - uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: 1.18 - name: copy working directory to GOPATH run: sudo mkdir -p /home/runner/go/src/github.com && sudo cp -a /home/runner/work/rook /home/runner/go/src/github.com/ diff --git a/Documentation/Contributing/development-flow.md b/Documentation/Contributing/development-flow.md index 004c7528e..21d5afcd9 100644 --- a/Documentation/Contributing/development-flow.md +++ b/Documentation/Contributing/development-flow.md @@ -7,7 +7,7 @@ don't hesitate to reach out to us on our [Slack](https://Rook-io.slack.com) dev ## Prerequisites -1. [GO 1.17](https://golang.org/dl/) or greater installed +1. [GO 1.18](https://golang.org/dl/) or greater installed 2. Git client installed 3. GitHub account diff --git a/build/makelib/golang.mk b/build/makelib/golang.mk index 0b179ffc8..88670880e 100644 --- a/build/makelib/golang.mk +++ b/build/makelib/golang.mk @@ -48,7 +48,7 @@ GO_TEST_FLAGS ?= # ==================================================================================== # Setup go environment -GO_SUPPORTED_VERSIONS ?= 1.17|1.18 +GO_SUPPORTED_VERSIONS ?= 1.18 GO_PACKAGES := $(foreach t,$(GO_SUBDIRS),$(GO_PROJECT)/$(t)/...) GO_INTEGRATION_TEST_PACKAGES := $(foreach t,$(GO_INTEGRATION_TESTS_SUBDIRS),$(GO_PROJECT)/$(t)/integration) @@ -65,7 +65,7 @@ GOPATH := $(shell go env GOPATH) # setup tools used during the build GOLINT := $(TOOLS_HOST_DIR)/golint -GOJUNIT := $(TOOLS_HOST_DIR)/go-junit-report +GOJUNIT := $(TOOLS_DIR)/go-junit-report GO := go GOHOST := GOOS=$(GOHOSTOS) GOARCH=$(GOHOSTARCH) go @@ -194,9 +194,10 @@ $(GOFMT): $(GOJUNIT): @echo === installing go-junit-report - @mkdir -p $(TOOLS_HOST_DIR)/tmp - @GOPATH=$(TOOLS_HOST_DIR)/tmp GOBIN=$(TOOLS_HOST_DIR) $(GOHOST) get github.com/jstemmer/go-junit-report - @$(GOHOST) clean -modcache + @mkdir -p $(TOOLS_DIR)/tmp + @curl -sL https://github.com/jstemmer/go-junit-report/releases/download/v2.0.0/go-junit-report-v2.0.0-$(GOOS)-$(GOHOSTARCH).tar.gz | tar -xz -C $(TOOLS_DIR)/tmp + @mv $(TOOLS_DIR)/tmp/go-junit-report $(TOOLS_DIR) + @rm -fr $(TOOLS_DIR)/tmp export CONTROLLER_GEN=$(TOOLS_HOST_DIR)/controller-gen-$(CONTROLLER_GEN_VERSION) $(CONTROLLER_GEN):