Skip to content

Commit 7601764

Browse files
authored
Merge pull request #2714 from camilamacedo86/go-1.18
✨ add support to go 1.18 and for (go/v3), update envtest version to use k8s 1.24
2 parents df40adf + 02da15b commit 7601764

File tree

32 files changed

+124
-34
lines changed

32 files changed

+124
-34
lines changed

.github/workflows/apidiff.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
- name: Setup Go
3838
uses: actions/setup-go@v2
3939
with:
40-
go-version: "1.17"
40+
go-version: "1.18"
4141
- name: Execute go-apidiff
4242
uses: joelanford/[email protected]
4343
with:

.github/workflows/testdata.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup Go
1919
uses: actions/setup-go@v2
2020
with:
21-
go-version: '1.17'
21+
go-version: '1.18'
2222
- name: Remove pre-installed kustomize
2323
# This step is needed as the following one tries to remove
2424
# kustomize for each test but has no permission to do so
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# todo: remove this file when go/v2 be removed
2+
name: Unit tests Legacy (go/v2)
3+
4+
# Trigger the workflow on pull requests and direct pushes to any branch
5+
on:
6+
push:
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
name: ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os:
16+
- ubuntu-latest
17+
- macos-latest
18+
# Pull requests from the same repository won't trigger this checks as they were already triggered by the push
19+
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
20+
steps:
21+
- name: Clone the code
22+
uses: actions/checkout@v2
23+
- name: Setup Go
24+
uses: actions/setup-go@v2
25+
with:
26+
# the go/v2 cannot be updated and is scaffold with golang 1.13
27+
# (version used by its dep version of the controller-runtime)
28+
# however, we are unable to downgrade the version here
29+
# because we will face errors
30+
# So we are keeping the latest version where it works
31+
# and highlighting that must be fixed
32+
# Therefore, we probably will deprecate go/v2 soon since we cannot upgrade it
33+
# to use the versions of controller-runtime > v0.9
34+
# and controller-tools > v0.6 as k8s > 1.21 then it might not be valid we spend effort on this fix
35+
go-version: "1.17"
36+
# This step is needed as the following one tries to remove
37+
# kustomize for each test but has no permission to do so
38+
- name: Remove pre-installed kustomize
39+
run: sudo rm -f /usr/local/bin/kustomize
40+
- name: Perform the test
41+
run: make test-legacy
42+
- name: Report failure
43+
uses: nashmaniac/[email protected]
44+
# Only report failures of pushes (PRs have are visible through the Checks section) to the default branch
45+
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/master'
46+
with:
47+
title: 🐛 Unit tests failed on ${{ matrix.os }} for ${{ github.sha }}
48+
token: ${{ secrets.GITHUB_TOKEN }}
49+
labels: kind/bug
50+
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

.github/workflows/unit-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Setup Go
4141
uses: actions/setup-go@v2
4242
with:
43-
go-version: "1.17"
43+
go-version: "1.18"
4444
# This step is needed as the following one tries to remove
4545
# kustomize for each test but has no permission to do so
4646
- name: Remove pre-installed kustomize
@@ -71,7 +71,7 @@ jobs:
7171
- name: Setup Go
7272
uses: actions/setup-go@v2
7373
with:
74-
go-version: "1.17"
74+
go-version: "1.18"
7575
- name: Generate the coverage output
7676
run: make test-coverage
7777
- name: Send the coverage output

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ check-testdata: ## Run the script to ensure that the testdata is updated
122122
test-testdata: ## Run the tests of the testdata directory
123123
./test/testdata/test.sh
124124

125+
#todo(remove the test-legacy whne the go/v2 be removed from kubebuilder)
126+
127+
.PHONY: test-legacy
128+
test-legacy: ## Run the legacy tests (go/v2) of the testdata directory
129+
./test/testdata/test_legacy.sh
130+
125131
.PHONY: test-e2e-local
126132
test-e2e-local: ## Run the end-to-end tests locally
127133
## To keep the same kind cluster between test runs, use `SKIP_KIND_CLEANUP=1 make test-e2e-local`

build/.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ builds:
4444
- darwin_amd64
4545
- darwin_arm64
4646
env:
47-
- KUBERNETES_VERSION=1.23.5
47+
- KUBERNETES_VERSION=1.24.1
4848
- CGO_ENABLED=0
4949

5050
# Only binaries of the form "kubebuilder_${goos}_${goarch}" will be released.

build/cloudbuild.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ steps:
3838
git checkout $${BRANCH_NAME}
3939
git branch --set-upstream-to=origin/$${BRANCH_NAME}
4040
git tag -d ${TAG_NAME}
41-
- name: "goreleaser/goreleaser:v1.8.3"
41+
- name: "goreleaser/goreleaser:v1.9.2"
4242
entrypoint: "bash"
4343
args: ["build/build_kubebuilder.sh"]
4444
secretEnv: ["GITHUB_TOKEN"]

build/cloudbuild_local.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# Release tar will be in ./cloudbuild
2020

2121
steps:
22-
- name: "goreleaser/goreleaser:v1.8.3"
22+
- name: "goreleaser/goreleaser:v1.9.2"
2323
entrypoint: "bash"
2424
env: ["SNAPSHOT=1"]
2525
args: ["build/build_kubebuilder.sh"]

build/cloudbuild_snapshot.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# Release tar will be in ./cloudbuild
2020

2121
steps:
22-
- name: "goreleaser/goreleaser:v1.8.3"
22+
- name: "goreleaser/goreleaser:v1.9.2"
2323
entrypoint: "bash"
2424
env: ["SNAPSHOT=1"]
2525
args: ["build/build_kubebuilder.sh"]

docs/book/src/quick-start.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ This Quick Start guide will cover:
1111

1212
- [go](https://golang.org/dl/) version v1.15+ (kubebuilder v3.0 < v3.1).
1313
- [go](https://golang.org/dl/) version v1.16+ (kubebuilder v3.1 < v3.3).
14-
- [go](https://golang.org/dl/) version v1.17+ < v1.18 (kubebuilder v3.3+).
14+
- [go](https://golang.org/dl/) version v1.17+ < v1.18 (kubebuilder v3.4.1).
15+
- [go](https://golang.org/dl/) version v1.17.9+ (kubebuilder v3.5+).
1516
- [docker](https://docs.docker.com/install/) version 17.03+.
1617
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) version v1.11.3+.
1718
- Access to a Kubernetes v1.11.3+ cluster.

0 commit comments

Comments
 (0)