From de2b68ebc174b2e68221e809a208187127eb888e Mon Sep 17 00:00:00 2001 From: Guillermo Gaston Date: Tue, 23 Aug 2022 19:58:15 -0500 Subject: [PATCH] Update Go version to 1.18 (#3100) * Add doc for Go version update process * Add entry to changelog about SHA-1 signed certs deprecation --- .github/workflows/go-coverage.yml | 6 ++++-- .github/workflows/golangci-lint.yml | 11 ++++++----- Makefile | 2 +- build/Dockerfile | 2 +- cmd/eksctl-anywhere/cmd/listovas.go | 7 +++++-- docs/content/en/docs/reference/changelog.md | 5 +++++ docs/developer/README.md | 2 ++ docs/developer/go-version.md | 10 ++++++++++ release/Makefile | 2 +- 9 files changed, 35 insertions(+), 12 deletions(-) create mode 100644 docs/developer/go-version.md diff --git a/.github/workflows/go-coverage.yml b/.github/workflows/go-coverage.yml index dc912e85369a..05e001841b00 100644 --- a/.github/workflows/go-coverage.yml +++ b/.github/workflows/go-coverage.yml @@ -12,9 +12,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v3 with: - go-version: 1.17.8 + go-version: '1.18' + check-latest: true + cache: true - name: Run go test with coverage run: COVER_PROFILE=coverage.txt make coverage-unit-test - name: Codecov upload diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 21a1c95f5794..4f85f4899e9d 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -11,12 +11,13 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v2 - with: - go-version: 1.17.8 - uses: actions/checkout@v2 + - uses: actions/setup-go@v3 + with: + go-version: '1.18' + check-latest: true + cache: true - name: golangci-lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3 with: version: v1.45.2 - skip-go-installation: true diff --git a/Makefile b/Makefile index dd5a8ad6340f..0d657063b97f 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ SHELL := /bin/bash ARTIFACTS_BUCKET?=my-s3-bucket GIT_VERSION?=$(shell git describe --tag) GIT_TAG?=$(shell git tag -l --sort -v:refname | head -1) -GOLANG_VERSION?="1.17" +GOLANG_VERSION?="1.18" GO_VERSION ?= $(shell source ./scripts/common.sh && build::common::get_go_path $(GOLANG_VERSION)) GO ?= $(GO_VERSION)/go GO_TEST ?= $(GO) test diff --git a/build/Dockerfile b/build/Dockerfile index ff7182ed3aae..cd76f60662fc 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1.1-experimental # Build the manager binary -FROM golang:1.17.8 as builder +FROM golang:1.18.5 as builder WORKDIR /workspace # Run this with docker build --build_arg $(go env GOPROXY) to override the goproxy diff --git a/cmd/eksctl-anywhere/cmd/listovas.go b/cmd/eksctl-anywhere/cmd/listovas.go index 2ca38baf0e1a..486e2c6d3f53 100644 --- a/cmd/eksctl-anywhere/cmd/listovas.go +++ b/cmd/eksctl-anywhere/cmd/listovas.go @@ -9,6 +9,8 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" + "golang.org/x/text/cases" + "golang.org/x/text/language" "sigs.k8s.io/yaml" eksav1alpha1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1" @@ -58,11 +60,12 @@ func listOvas(context context.Context, spec string) error { bundle := clusterSpec.VersionsBundle + titler := cases.Title(language.English) for _, ova := range bundle.Ovas() { if strings.Contains(ova.URI, string(eksav1alpha1.Bottlerocket)) { - fmt.Printf("%s:\n", strings.Title(string(eksav1alpha1.Bottlerocket))) + fmt.Printf("%s:\n", titler.String(string(eksav1alpha1.Bottlerocket))) } else { - fmt.Printf("%s:\n", strings.Title(string(eksav1alpha1.Ubuntu))) + fmt.Printf("%s:\n", titler.String(string(eksav1alpha1.Ubuntu))) } output := listOvasOutput{ URI: ova.URI, diff --git a/docs/content/en/docs/reference/changelog.md b/docs/content/en/docs/reference/changelog.md index 6b952adcf677..c0feb7775ffd 100644 --- a/docs/content/en/docs/reference/changelog.md +++ b/docs/content/en/docs/reference/changelog.md @@ -4,6 +4,11 @@ linkTitle: "What's New?" weight: 35 --- +## Unreleased + +### ⚠️ Breaking changes +- Certificates signed with SHA-1 are not supported anymore for Registry Mirror. Users with a registry mirror and providing a custom CA cert will need to rotate the certificate served by the registry mirror endpoint before using the new EKS-A version. This is true for both new clusters (`create cluster` command) and existing clusters (`upgrade cluster` command). + ## [v0.11.0](https://github.com/aws/eks-anywhere/releases/tag/v0.11.0) ### Breaking Changes diff --git a/docs/developer/README.md b/docs/developer/README.md index b7ab25faa17d..c93a9c6ab990 100644 --- a/docs/developer/README.md +++ b/docs/developer/README.md @@ -7,3 +7,5 @@ [Pull Request Guidelines](pull-requests.md) [Issue Management](issues.md) + +[Go Version](go-version.md) diff --git a/docs/developer/go-version.md b/docs/developer/go-version.md new file mode 100644 index 000000000000..004bffff6554 --- /dev/null +++ b/docs/developer/go-version.md @@ -0,0 +1,10 @@ +# Go version + +## How to update the repo's Go Version + +1. Make sure the [image builder](https://github.com/aws/eks-anywhere-build-tooling/blob/main/build/lib/install_go_versions.sh#L37) supports the new Go minor version. If it doesn't, you will need to add it there first. +1. Update `GOLANG_VERSION` in the [main `Makefile`](https://github.com/aws/eks-anywhere/blob/main/Makefile#L23) +1. Update `GOLANG_VERSION` in the [`release` `Makefile`](https://github.com/aws/eks-anywhere/blob/main/release/Makefile#L45) +1. Update `go-version` in [`codecov` workflow](https://github.com/aws/eks-anywhere/blob/main/.github/workflows/go-coverage.yml#L17) +1. Update `go-version` in [`golangci-lint` workflow](https://github.com/aws/eks-anywhere/blob/main/.github/workflows/golangci-lint.yml#L17) +1. Update the base image in the [controller's `Dockerfile`](https://github.com/aws/eks-anywhere/blob/main/build/Dockerfile#L4) \ No newline at end of file diff --git a/release/Makefile b/release/Makefile index 8c8264ddc311..bc9cd8a84b0b 100644 --- a/release/Makefile +++ b/release/Makefile @@ -42,7 +42,7 @@ GOBIN=$(shell go env GOBIN) endif # Setup Go -GOLANG_VERSION?="1.17" +GOLANG_VERSION?="1.18" GO_VERSION ?= $(shell source ../scripts/common.sh && build::common::get_go_path $(GOLANG_VERSION)) GO ?= $(GO_VERSION)/go