Skip to content

Commit 3be7588

Browse files
committed
Bump go 1.18.1
Kubernetes 1.24 switched to go 1.18.1 as well. * Remove as many hard-coded go versions as possible * Also regenerate go.mod/go.sum for CI dependencies * Add empty go.mod to ignore build directory from go tools See golang/go#30058 (comment) * Add missing dependencies to Makefile targets * Set git config advice.detachedHead=false for embedded binaries So that there's less log spam * Change go get to go install for Konnectivity Signed-off-by: Tom Wieczorek <[email protected]>
1 parent c9ae749 commit 3be7588

File tree

18 files changed

+640
-560
lines changed

18 files changed

+640
-560
lines changed

.github/workflows/check-network.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ on:
88
schedule:
99
- cron: "0 23 * * *"
1010

11-
env:
12-
GO_VERSION: ~1.17
13-
GO_VERSION_WIN: ~1.17
14-
1511
jobs:
1612
terraform:
1713
env:
@@ -46,7 +42,10 @@ jobs:
4642
with:
4743
ref: ${{ env.github_ref }}
4844

49-
- name: Set up Go 1.x
45+
- name: Prepare build environment
46+
run: .github/workflows/prepare-build-env.sh
47+
48+
- name: Set up Go
5049
uses: actions/setup-go@v3
5150
with:
5251
go-version: ${{ env.GO_VERSION }}

.github/workflows/lint.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ on:
2929
- 'mkdocs.yml'
3030
- '*.md'
3131

32-
env:
33-
GO_VERSION: ~1.17
34-
GO_VERSION_WIN: ~1.17
35-
3632
jobs:
3733
lint:
3834
name: Lint
@@ -41,7 +37,10 @@ jobs:
4137
steps:
4238
- uses: actions/checkout@v3
4339

44-
- name: Set up Go 1.x
40+
- name: Prepare build environment
41+
run: .github/workflows/prepare-build-env.sh
42+
43+
- name: Set up Go
4544
uses: actions/setup-go@v3
4645
with:
4746
go-version: ${{ env.GO_VERSION }}

.github/workflows/release.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
tags:
66
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
77
#pull_request:
8-
env:
9-
GO_VERSION: ~1.17
10-
GO_VERSION_WIN: ~1.17
118

129
jobs:
1310
release:
@@ -51,11 +48,13 @@ jobs:
5148
- name: Check out code into the Go module directory
5249
uses: actions/checkout@v3
5350

54-
- name: Set up Go 1.16
51+
- name: Prepare build environment
52+
run: .github/workflows/prepare-build-env.sh
53+
54+
- name: Set up Go
5555
uses: actions/setup-go@v3
5656
with:
5757
go-version: ${{ env.GO_VERSION }}
58-
id: go
5958

6059
- name: Build
6160
run: make EMBEDDED_BINS_BUILDMODE=docker
@@ -118,11 +117,13 @@ jobs:
118117
- name: Check out code into the Go module directory
119118
uses: actions/checkout@v3
120119

121-
- name: Set up Go 1.x
120+
- name: Prepare build environment
121+
run: .github/workflows/prepare-build-env.sh
122+
123+
- name: Set up Go
122124
uses: actions/setup-go@v3
123125
with:
124126
go-version: ${{ env.GO_VERSION }}
125-
id: go
126127

127128
- name: Build
128129
run: make EMBEDDED_BINS_BUILDMODE=docker k0s.exe
@@ -154,11 +155,13 @@ jobs:
154155
- name: Check out code into the Go module directory
155156
uses: actions/checkout@v3
156157

157-
- name: Set up Go 1.x
158+
- name: Prepare build environment
159+
run: .github/workflows/prepare-build-env.sh
160+
161+
- name: Set up Go
158162
uses: actions/setup-go@v3
159163
with:
160164
go-version: ${{ env.GO_VERSION }}
161-
id: go
162165

163166
- name: Build
164167
run: make EMBEDDED_BINS_BUILDMODE=docker
@@ -171,7 +174,6 @@ jobs:
171174
- name: Run basic smoke test
172175
run: make check-basic
173176

174-
175177
- name: Build bundle for air gap installation
176178
run: make image-bundle/bundle.tar
177179

@@ -345,11 +347,13 @@ jobs:
345347
- name: Run git checkout
346348
uses: actions/checkout@v3
347349

348-
- name: Set up Go 1.x
350+
- name: Prepare build environment
351+
run: .github/workflows/prepare-build-env.sh
352+
353+
- name: Set up Go
349354
uses: actions/setup-go@v3
350355
with:
351356
go-version: ${{ env.GO_VERSION }}
352-
id: go
353357

354358
- name: Setup Terraform
355359
uses: hashicorp/setup-terraform@v2

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ endif
105105
.PHONY: all
106106
all: k0s k0s.exe
107107

108-
go.sum: go.mod
108+
go.sum: go.mod .k0sbuild.docker-image.k0s
109109
$(GO) mod tidy
110110

111111
codegen_targets = \
@@ -142,7 +142,7 @@ k0s: .k0sbuild.docker-image.k0s
142142

143143
k0s.exe: TARGET_OS = windows
144144
k0s.exe: BUILD_GO_CGO_ENABLED = 0
145-
k0s.exe: GOLANG_IMAGE = golang:1.17-alpine
145+
k0s.exe: GOLANG_IMAGE = golang:$(go_version)-alpine
146146

147147
k0s.exe k0s: $(codegen_targets)
148148

build/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
ARG BUILDIMAGE=golang:1.17-alpine
2-
1+
ARG BUILDIMAGE
32
FROM $BUILDIMAGE
43
RUN apk add --no-cache gcc musl-dev binutils-gold
54

build/go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Intentionally left empty
2+
// https://github.com/golang/go/issues/30058#issuecomment-543815369

embedded-bins/Makefile.variables

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
go_version = 1.17.9
1+
go_version = 1.18.1
22

33
runc_version = 1.1.1
44
runc_buildimage = golang:$(go_version)-alpine

embedded-bins/containerd/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG BUILDIMAGE=golang:1.17-alpine
1+
ARG BUILDIMAGE
22
FROM $BUILDIMAGE AS build
33

44
ARG VERSION
@@ -16,7 +16,7 @@ RUN apk upgrade -U -a && apk add \
1616
protoc
1717

1818
RUN mkdir -p $GOPATH/src/github.com/containerd/containerd
19-
RUN git clone -b v$VERSION --depth=1 https://github.com/containerd/containerd.git $GOPATH/src/github.com/containerd/containerd
19+
RUN git -c advice.detachedHead=false clone -b v$VERSION --depth=1 https://github.com/containerd/containerd.git $GOPATH/src/github.com/containerd/containerd
2020
WORKDIR /go/src/github.com/containerd/containerd
2121
RUN go version
2222
RUN make \

embedded-bins/etcd/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG BUILDIMAGE=golang:1.17-alpine
1+
ARG BUILDIMAGE
22
FROM $BUILDIMAGE AS build
33

44
ARG VERSION
@@ -10,7 +10,7 @@ ARG BUILD_GO_LDFLAGS_EXTRA
1010

1111
RUN apk add build-base git
1212

13-
RUN cd / && git clone -b v$VERSION --depth=1 https://github.com/etcd-io/etcd.git
13+
RUN cd / && git -c advice.detachedHead=false clone -b v$VERSION --depth=1 https://github.com/etcd-io/etcd.git
1414
WORKDIR /etcd/server
1515
RUN go version
1616
RUN CGO_ENABLED=${BUILD_GO_CGO_ENABLED} \

embedded-bins/kine/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG BUILDIMAGE=golang:1.17-alpine
1+
ARG BUILDIMAGE
22
FROM $BUILDIMAGE AS build
33

44
ARG VERSION
@@ -11,7 +11,7 @@ ARG BUILD_GO_LDFLAGS_EXTRA
1111
RUN apk add build-base git
1212

1313

14-
RUN cd / && git clone -b v$VERSION --depth=1 https://github.com/rancher/kine.git
14+
RUN cd / && git -c advice.detachedHead=false clone -b v$VERSION --depth=1 https://github.com/rancher/kine.git
1515
WORKDIR /kine
1616
RUN go version
1717
RUN CGO_ENABLED=${BUILD_GO_CGO_ENABLED} \

0 commit comments

Comments
 (0)