Skip to content

Commit

Permalink
Upgrade to Go 1.18 (#150)
Browse files Browse the repository at this point in the history
Also let it still support 1.17 to ease upgrade.

Going forward we should aim to support the same latest 2 Go versions that the Go team actively supports.

Signed-off-by: Jose Luis Vazquez Gonzalez josvaz@vmware.com
  • Loading branch information
josvaz committed Apr 20, 2022
1 parent c529788 commit b4b4723
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.17.x
go-version: 1.18.x
- name: Release
uses: goreleaser/goreleaser-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Development

The Asset Relocation Tool for Kubernetes is built with Golang 1.17.
The Asset Relocation Tool for Kubernetes is built preferably with Golang 1.18, although 1.17 is also supported.

### Running tests

Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ default: build
.PHONY: deps-go-binary deps-counterfeiter deps-ginkgo deps-golangci-lint

GO_VERSION := $(shell go version)
GO_VERSION_REQUIRED = go1.17
GO_VERSION_MATCHED := $(shell go version | grep $(GO_VERSION_REQUIRED))
PREFERRED_VERSION=1.18
PREVIOUS_VERSION=1.17
VERSION_MATCHED := $(shell go version | grep "$(PREFERRED_VERSION)\|$(PREVIOUS_VERSION)")

deps-go-binary:
ifndef GO_VERSION
$(error Go not installed)
endif
ifndef GO_VERSION_MATCHED
$(error Required Go version is $(GO_VERSION_REQUIRED), but was $(GO_VERSION))
ifndef VERSION_MATCHED
$(error Required Go versions are $(PREFERRED_VERSION) or $(PREVIOUS_VERSION), but we have $(GO_VERSION))
endif
@:

Expand Down
2 changes: 1 addition & 1 deletion ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM harbor-repo.vmware.com/dockerhub-proxy-cache/library/photon:3.0-20210716
WORKDIR /

# Install required packages
RUN yum -y install build-essential coreutils gawk gcc git go-1.17.2-1.ph3.x86_64 jq make
RUN yum -y install build-essential coreutils gawk gcc git go-1.18.2-1.ph3.x86_64 jq make
ENV PATH="/root/go/bin:${PATH}"

# Install go packages used for building and testing
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/vmware-tanzu/asset-relocation-tool-for-kubernetes

go 1.17
go 1.18

require (
github.com/avast/retry-go v3.0.0+incompatible
Expand Down
2 changes: 1 addition & 1 deletion test/registry/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright 2021 VMware, Inc.
# SPDX-License-Identifier: BSD-2-Clause
FROM golang:1.17 as compiled
FROM golang:1.18 as compiled
RUN cd /go && \
GO111MODULE=off go get -u filippo.io/mkcert && \
cd src/filippo.io/mkcert && \
Expand Down

0 comments on commit b4b4723

Please sign in to comment.