From 2ec3edc754d319f0094cee90c6e5dfc9fb03897f Mon Sep 17 00:00:00 2001 From: Waleed Malik Date: Tue, 24 Oct 2023 13:46:08 +0500 Subject: [PATCH] Upgrade to Go 1.21.3 (#325) Signed-off-by: Waleed Malik --- .golangci.yml | 3 --- .prow/postsubmits.yaml | 4 ++-- .prow/verify.yaml | 10 ++++----- Dockerfile | 2 +- hack/update-codegen.sh | 2 +- hack/update-crds-openapi.sh | 2 +- hack/verify-licenses.sh | 2 +- pkg/controllers/osc/osc_reconciler_test.go | 25 +++++++++++----------- 8 files changed, 24 insertions(+), 26 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 3cf422c1..f3521d6a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -26,7 +26,6 @@ linters: - asciicheck - bidichk - bodyclose - - deadcode - depguard - durationcheck - errcheck @@ -51,12 +50,10 @@ linters: - promlinter - revive - staticcheck - - structcheck - tenv - typecheck - unconvert - unused - - varcheck - wastedassign - whitespace disable-all: true diff --git a/.prow/postsubmits.yaml b/.prow/postsubmits.yaml index d7b59cc7..c7678bf7 100644 --- a/.prow/postsubmits.yaml +++ b/.prow/postsubmits.yaml @@ -26,7 +26,7 @@ postsubmits: preset-goproxy: "true" spec: containers: - - image: quay.io/kubermatic/build:go-1.21-node-18-kind-0.20-1 + - image: quay.io/kubermatic/build:go-1.21-node-18-kind-0.20-6 command: - /bin/bash - -c @@ -53,7 +53,7 @@ postsubmits: preset-goproxy: "true" spec: containers: - - image: quay.io/kubermatic/build:go-1.21-node-18-kind-0.20-1 + - image: quay.io/kubermatic/build:go-1.21-node-18-kind-0.20-6 command: - "./hack/ci/upload-gocache.sh" resources: diff --git a/.prow/verify.yaml b/.prow/verify.yaml index 9c78c5b4..d61e1c25 100644 --- a/.prow/verify.yaml +++ b/.prow/verify.yaml @@ -36,7 +36,7 @@ presubmits: preset-goproxy: "true" spec: containers: - - image: golang:1.21.0 + - image: golang:1.21.3 command: - make args: @@ -79,7 +79,7 @@ presubmits: preset-goproxy: "true" spec: containers: - - image: quay.io/kubermatic/build:go-1.21-node-18-kind-0.20-1 + - image: quay.io/kubermatic/build:go-1.21-node-18-kind-0.20-6 command: - ./hack/verify-licenses.sh resources: @@ -95,7 +95,7 @@ presubmits: preset-goproxy: "true" spec: containers: - - image: golangci/golangci-lint:v1.54.1 + - image: golangci/golangci-lint:v1.55.0 command: - make args: @@ -161,7 +161,7 @@ presubmits: preset-goproxy: "true" spec: containers: - - image: golang:1.21.0 + - image: golang:1.21.3 command: - make args: @@ -182,7 +182,7 @@ presubmits: preset-goproxy: "true" spec: containers: - - image: quay.io/kubermatic/build:go-1.21-node-18-kind-0.20-1 + - image: quay.io/kubermatic/build:go-1.21-node-18-kind-0.20-6 command: - "./hack/ci/run-e2e-tests.sh" resources: diff --git a/Dockerfile b/Dockerfile index ecbfb495..20f36d8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG GO_VERSION=1.21.0 +ARG GO_VERSION=1.21.3 FROM golang:${GO_VERSION} AS builder WORKDIR /go/src/k8c.io/operating-system-manager COPY . . diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index a6acafb9..7777a37b 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -19,7 +19,7 @@ set -euo pipefail cd $(dirname $0)/.. source hack/lib.sh -CONTAINERIZE_IMAGE=golang:1.21.0 containerize ./hack/update-codegen.sh +CONTAINERIZE_IMAGE=golang:1.21.3 containerize ./hack/update-codegen.sh SCRIPT_ROOT=$(dirname "${BASH_SOURCE}") sed="sed" diff --git a/hack/update-crds-openapi.sh b/hack/update-crds-openapi.sh index 413c0cba..33acf1e6 100755 --- a/hack/update-crds-openapi.sh +++ b/hack/update-crds-openapi.sh @@ -19,7 +19,7 @@ set -euo pipefail cd $(dirname $0)/.. source hack/lib.sh -CONTAINERIZE_IMAGE=golang:1.21.0 containerize ./hack/update-crds-openapi.sh +CONTAINERIZE_IMAGE=golang:1.21.3 containerize ./hack/update-crds-openapi.sh SCRIPT_ROOT=$(dirname "${BASH_SOURCE}") echodate "Creating vendor directory" diff --git a/hack/verify-licenses.sh b/hack/verify-licenses.sh index 25d434c2..4e461daa 100755 --- a/hack/verify-licenses.sh +++ b/hack/verify-licenses.sh @@ -19,7 +19,7 @@ set -euo pipefail cd $(dirname $0)/.. source hack/lib.sh -CONTAINERIZE_IMAGE=quay.io/kubermatic/build:go-1.21-node-18-kind-0.20-1 containerize ./hack/verify-licenses.sh +CONTAINERIZE_IMAGE=quay.io/kubermatic/build:go-1.21-node-18-kind-0.20-6 containerize ./hack/verify-licenses.sh go mod vendor diff --git a/pkg/controllers/osc/osc_reconciler_test.go b/pkg/controllers/osc/osc_reconciler_test.go index e9be3fca..79c4192e 100644 --- a/pkg/controllers/osc/osc_reconciler_test.go +++ b/pkg/controllers/osc/osc_reconciler_test.go @@ -81,6 +81,7 @@ kPe6XoSbiLm/kxk32T0= const ( defaultOSPPathPrefix = "../../../../deploy/osps/default/" defaultKubeletVersion = "1.22.2" + ospUbuntu = "osp-ubuntu" ) const ( @@ -136,8 +137,8 @@ func TestReconciler_Reconcile(t *testing.T) { }{ { name: "Ubuntu OS in AWS with Containerd", - ospFile: defaultOSPPathPrefix + "osp-ubuntu.yaml", - ospName: "osp-ubuntu", + ospFile: defaultOSPPathPrefix + fmt.Sprintf("%s.yaml", ospUbuntu), + ospName: ospUbuntu, operatingSystem: providerconfigtypes.OperatingSystemUbuntu, oscFile: "osc-ubuntu-aws-containerd.yaml", mdName: "ubuntu-aws", @@ -154,8 +155,8 @@ func TestReconciler_Reconcile(t *testing.T) { }, { name: "Ubuntu OS in AWS with Dualstack Networking", - ospFile: defaultOSPPathPrefix + "osp-ubuntu.yaml", - ospName: "osp-ubuntu", + ospFile: defaultOSPPathPrefix + fmt.Sprintf("%s.yaml", ospUbuntu), + ospName: ospUbuntu, operatingSystem: providerconfigtypes.OperatingSystemUbuntu, oscFile: "osc-ubuntu-aws-dualstack.yaml", mdName: "ubuntu-aws", @@ -173,8 +174,8 @@ func TestReconciler_Reconcile(t *testing.T) { }, { name: "Ubuntu OS in AWS with Dualstack IPv6+IPv4 Networking", - ospFile: defaultOSPPathPrefix + "osp-ubuntu.yaml", - ospName: "osp-ubuntu", + ospFile: defaultOSPPathPrefix + fmt.Sprintf("%s.yaml", ospUbuntu), + ospName: ospUbuntu, operatingSystem: providerconfigtypes.OperatingSystemUbuntu, oscFile: "osc-ubuntu-aws-dualstack-IPv6+IPv4.yaml", mdName: "ubuntu-aws", @@ -246,8 +247,8 @@ func TestReconciler_Reconcile(t *testing.T) { }, { name: "Kubelet configuration with containerd", - ospFile: defaultOSPPathPrefix + "osp-ubuntu.yaml", - ospName: "osp-ubuntu", + ospFile: defaultOSPPathPrefix + fmt.Sprintf("%s.yaml", ospUbuntu), + ospName: ospUbuntu, operatingSystem: providerconfigtypes.OperatingSystemUbuntu, oscFile: "osc-kubelet-configuration-containerd.yaml", mdName: "kubelet-configuration", @@ -421,8 +422,8 @@ func TestOSCAndSecretRotation(t *testing.T) { }{ { name: "test updates of machineDeployment", - ospFile: defaultOSPPathPrefix + "osp-ubuntu.yaml", - ospName: "osp-ubuntu", + ospFile: defaultOSPPathPrefix + fmt.Sprintf("%s.yaml", ospUbuntu), + ospName: ospUbuntu, operatingSystem: providerconfigtypes.OperatingSystemUbuntu, oscFile: "osc-ubuntu-aws-containerd.yaml", mdName: "ubuntu-aws", @@ -617,8 +618,8 @@ func TestMachineDeploymentDeletion(t *testing.T) { }{ { name: "test the deletion of machineDeployment", - ospFile: defaultOSPPathPrefix + "osp-ubuntu.yaml", - ospName: "osp-ubuntu", + ospFile: defaultOSPPathPrefix + fmt.Sprintf("%s.yaml", ospUbuntu), + ospName: ospUbuntu, operatingSystem: providerconfigtypes.OperatingSystemUbuntu, oscFile: "osc-ubuntu-aws-containerd.yaml", mdName: "ubuntu-aws",