Skip to content

Commit b928065

Browse files
authored
Update golang to 1.22 (#238)
* Update golang to 1.22 Signed-off-by: Lubron Zhan <[email protected]> * Update kustomize as well Signed-off-by: Lubron Zhan <[email protected]> * Fix the generated.deepcopy.go Signed-off-by: Lubron Zhan <[email protected]> * Fix the header check script Signed-off-by: Lubron Zhan <[email protected]> * Update the kubebuild and use envtest to pull binarie Signed-off-by: Lubron Zhan <[email protected]> * Ping setup-envtest to version v0.0.0-20240215143116-d0396a3d6f9f Signed-off-by: Lubron Zhan <[email protected]> * Fix indentation Signed-off-by: Lubron Zhan <[email protected]> --------- Signed-off-by: Lubron Zhan <[email protected]>
1 parent cf5240c commit b928065

File tree

11 files changed

+200
-899
lines changed

11 files changed

+200
-899
lines changed

.github/workflows/actions.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
types: [opened, synchronize]
55

66
env:
7-
GO_VERSION: '1.20'
7+
GO_VERSION: '1.22'
88

99
jobs:
1010
lint:

.github/workflows/push.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'release-**'
77

88
env:
9-
GO_VERSION: '1.20'
9+
GO_VERSION: '1.22'
1010

1111
jobs:
1212
lint:

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
# Build the manager binary
5-
FROM golang:1.20.3-bullseye AS builder
5+
FROM golang:1.22-bullseye AS builder
66

77
WORKDIR /workspace
88
# Copy the Go Modules manifests

api/v1alpha1/zz_generated.deepcopy.go

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/vmware-tanzu/load-balancer-operator-for-kubernetes
22

3-
go 1.20
3+
go 1.22
44

55
require (
66
github.com/bitly/go-simplejson v0.5.1

go.sum

+30
Large diffs are not rendered by default.

hack/header-check.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ for file in $(all-files); do
5151
fi
5252

5353
if [[ "${file#*.}" == "deepcopy.go" ]]; then
54-
increment=3
54+
increment=2
5555
fi
5656

5757
for count in $(seq 1 ${#HEADER[@]}); do

hack/tools/Makefile

+18-13
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ export GOPROXY
2020
export GO111MODULE := on
2121

2222
# Directories.
23-
BIN_DIR := bin
23+
BIN_DIR := $(shell pwd)/bin
2424
SRCS := go.mod go.sum
2525

2626
# Versions.
27-
KUBEBUILDER_VERSION=2.3.0
28-
KUBECTL_VERSION=1.16.4
27+
KUBEBUILDER_VERSION=3.14.2
28+
K8S_VERSION=1.29.3
2929

3030
# Host information.
3131
HOST_OS=$(shell go env GOOS)
@@ -43,6 +43,7 @@ KUBECTL := $(BIN_DIR)/kubectl
4343
ETCD := $(BIN_DIR)/etcd
4444
KIND := $(BIN_DIR)/kind
4545
JQ := $(BIN_DIR)/jq
46+
ENVTEST := $(BIN_DIR)/setup-envtest
4647

4748
## --------------------------------------
4849
## Help
@@ -68,7 +69,7 @@ $(GOLANGCI_LINT):
6869
kustomize: $(KUSTOMIZE) $(SRCS)
6970
kustomize: ## Build kustomize
7071
$(KUSTOMIZE):
71-
go build -tags=tools -o $@ sigs.k8s.io/kustomize/kustomize/v4
72+
go build -tags=tools -o $@ sigs.k8s.io/kustomize/kustomize/v5
7273

7374
conversion-gen: $(CONVERSION_GEN) $(SRCS)
7475
conversion-gen: ## Build conversion-gen
@@ -90,20 +91,24 @@ $(JQ):
9091
curl -o $(@) -L https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 && \
9192
chmod a+x $(@)
9293

94+
.PHONY: envtest
95+
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
96+
$(ENVTEST):
97+
GOBIN=$(BIN_DIR) go install sigs.k8s.io/controller-runtime/tools/[email protected]
98+
9399
etcd: $(ETCD) ## Install etcd
94100
kube-apiserver: $(KUBE_APISERVER) ## Install kube-apiserver
101+
kubectl: $(KUBECTL) ## Install kubectl
102+
$(ETCD) $(KUBE_APISERVER) $(KUBECTL): envtest
103+
TEMP_DL_DIR=$(shell mktemp -d) && \
104+
GOBIN=$(BIN_DIR) $(ENVTEST) use $(K8S_VERSION) --bin-dir "$${TEMP_DL_DIR}" && \
105+
cp "$${TEMP_DL_DIR}"/k8s/*/* $(@D)
106+
95107
kubebuilder: $(KUBEBUILDER) ## Install kubebuilder
96-
$(ETCD) $(KUBE_APISERVER) $(KUBEBUILDER):
108+
$(KUBEBUILDER):
97109
@mkdir -p $(@D)
98110
TEMP_DL_DIR=$$(mktemp -d) && \
99-
curl -sL https://github.com/kubernetes-sigs/kubebuilder/releases/download/v$(KUBEBUILDER_VERSION)/kubebuilder_$(KUBEBUILDER_VERSION)_$(HOST_OS)_$(HOST_ARCH).tar.gz | \
100-
tar -xz -C "$${TEMP_DL_DIR}" --exclude=kubectl && \
101-
mv "$${TEMP_DL_DIR}/"*/bin/* $(@D)
102-
103-
kubectl: $(KUBECTL) ## Install kubectl
104-
$(KUBECTL):
105-
curl -sL https://storage.googleapis.com/kubernetes-release/release/v$(KUBECTL_VERSION)/bin/$(HOST_OS)/$(HOST_ARCH)/kubectl -o $(@) && \
106-
chmod a+x $(@)
111+
curl -sL https://github.com/kubernetes-sigs/kubebuilder/releases/download/v$(KUBEBUILDER_VERSION)/kubebuilder_$(KUBEBUILDER_VERSION)_$(HOST_OS)_$(HOST_ARCH) -O $(KUBEBUILDER)
107112

108113
## --------------------------------------
109114
## Generate

hack/tools/go.mod

+40-46
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,82 @@
11
module gitlab.eng.vmware.com/core-build/tkg-connectivity/hack/tools
22

3-
go 1.21
3+
go 1.22
44

55
require (
66
carvel.dev/ytt v0.48.0
77
github.com/onsi/ginkgo v1.16.5
8-
k8s.io/code-generator v0.26.1
9-
sigs.k8s.io/controller-tools v0.9.2
8+
k8s.io/code-generator v0.29.0
9+
sigs.k8s.io/controller-tools v0.14.0
1010
sigs.k8s.io/kind v0.22.0
11-
sigs.k8s.io/kustomize/kustomize/v4 v4.5.7
11+
sigs.k8s.io/kustomize/kustomize/v5 v5.4.1
1212
)
1313

1414
require (
1515
github.com/BurntSushi/toml v1.2.1 // indirect
1616
github.com/alessio/shellescape v1.4.1 // indirect
17-
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
17+
github.com/blang/semver/v4 v4.0.0 // indirect
1818
github.com/cppforlife/cobrautil v0.0.0-20200514214827-bb86e6965d72 // indirect
1919
github.com/cppforlife/go-cli-ui v0.0.0-20200505234325-512793797f05 // indirect
20-
github.com/davecgh/go-spew v1.1.1 // indirect
21-
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
22-
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
20+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
21+
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
2322
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
24-
github.com/fatih/color v1.12.0 // indirect
25-
github.com/fsnotify/fsnotify v1.4.9 // indirect
26-
github.com/go-errors/errors v1.0.1 // indirect
27-
github.com/go-logr/logr v1.2.3 // indirect
28-
github.com/go-openapi/jsonpointer v0.19.5 // indirect
29-
github.com/go-openapi/jsonreference v0.20.0 // indirect
30-
github.com/go-openapi/swag v0.19.14 // indirect
31-
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
32-
github.com/gobuffalo/flect v0.2.5 // indirect
23+
github.com/fatih/color v1.16.0 // indirect
24+
github.com/fsnotify/fsnotify v1.7.0 // indirect
25+
github.com/go-errors/errors v1.4.2 // indirect
26+
github.com/go-logr/logr v1.3.0 // indirect
27+
github.com/go-openapi/jsonpointer v0.19.6 // indirect
28+
github.com/go-openapi/jsonreference v0.20.2 // indirect
29+
github.com/go-openapi/swag v0.22.4 // indirect
30+
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
31+
github.com/gobuffalo/flect v1.0.2 // indirect
3332
github.com/gogo/protobuf v1.3.2 // indirect
34-
github.com/golang/protobuf v1.5.2 // indirect
35-
github.com/google/gnostic v0.5.7-v3refs // indirect
36-
github.com/google/go-cmp v0.5.9 // indirect
33+
github.com/golang/protobuf v1.5.3 // indirect
34+
github.com/google/gnostic-models v0.6.8 // indirect
3735
github.com/google/gofuzz v1.2.0 // indirect
3836
github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 // indirect
3937
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
4038
github.com/hashicorp/go-version v1.6.0 // indirect
41-
github.com/imdario/mergo v0.3.6 // indirect
4239
github.com/inconshreveable/mousetrap v1.1.0 // indirect
4340
github.com/josharian/intern v1.0.0 // indirect
4441
github.com/json-iterator/go v1.1.12 // indirect
4542
github.com/k14s/starlark-go v0.0.0-20200720175618-3a5c849cc368 // indirect
46-
github.com/mailru/easyjson v0.7.6 // indirect
47-
github.com/mattn/go-colorable v0.1.8 // indirect
48-
github.com/mattn/go-isatty v0.0.14 // indirect
49-
github.com/mattn/go-runewidth v0.0.7 // indirect
50-
github.com/mitchellh/mapstructure v1.4.1 // indirect
43+
github.com/mailru/easyjson v0.7.7 // indirect
44+
github.com/mattn/go-colorable v0.1.13 // indirect
45+
github.com/mattn/go-isatty v0.0.20 // indirect
5146
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
5247
github.com/modern-go/reflect2 v1.0.2 // indirect
5348
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
5449
github.com/nxadm/tail v1.4.8 // indirect
55-
github.com/olekukonko/tablewriter v0.0.4 // indirect
5650
github.com/pelletier/go-toml v1.9.4 // indirect
5751
github.com/pkg/errors v0.9.1 // indirect
58-
github.com/spf13/cobra v1.7.0 // indirect
52+
github.com/spf13/cobra v1.8.0 // indirect
5953
github.com/spf13/pflag v1.0.5 // indirect
60-
github.com/stretchr/objx v0.5.0 // indirect
61-
github.com/xlab/treeprint v1.1.0 // indirect
54+
github.com/xlab/treeprint v1.2.0 // indirect
6255
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
63-
golang.org/x/mod v0.8.0 // indirect
56+
golang.org/x/mod v0.14.0 // indirect
6457
golang.org/x/net v0.23.0 // indirect
6558
golang.org/x/sys v0.18.0 // indirect
6659
golang.org/x/text v0.14.0 // indirect
67-
golang.org/x/tools v0.6.0 // indirect
68-
google.golang.org/protobuf v1.28.1 // indirect
60+
golang.org/x/tools v0.16.1 // indirect
61+
google.golang.org/protobuf v1.33.0 // indirect
62+
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
6963
gopkg.in/inf.v0 v0.9.1 // indirect
7064
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
7165
gopkg.in/yaml.v2 v2.4.0 // indirect
7266
gopkg.in/yaml.v3 v3.0.1 // indirect
73-
k8s.io/api v0.24.0 // indirect
74-
k8s.io/apiextensions-apiserver v0.24.0 // indirect
75-
k8s.io/apimachinery v0.24.0 // indirect
76-
k8s.io/gengo v0.0.0-20220902162205-c0856e24416d // indirect
77-
k8s.io/klog/v2 v2.80.1 // indirect
78-
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
79-
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect
80-
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect
81-
sigs.k8s.io/kustomize/api v0.12.1 // indirect
82-
sigs.k8s.io/kustomize/cmd/config v0.10.9 // indirect
83-
sigs.k8s.io/kustomize/kyaml v0.13.9 // indirect
84-
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
85-
sigs.k8s.io/yaml v1.3.0 // indirect
67+
k8s.io/api v0.29.0 // indirect
68+
k8s.io/apiextensions-apiserver v0.29.0 // indirect
69+
k8s.io/apimachinery v0.29.0 // indirect
70+
k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 // indirect
71+
k8s.io/klog/v2 v2.110.1 // indirect
72+
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
73+
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
74+
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
75+
sigs.k8s.io/kustomize/api v0.17.1 // indirect
76+
sigs.k8s.io/kustomize/cmd/config v0.14.0 // indirect
77+
sigs.k8s.io/kustomize/kyaml v0.17.0 // indirect
78+
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
79+
sigs.k8s.io/yaml v1.4.0 // indirect
8680
)
8781

8882
replace go.starlark.net => github.com/k14s/starlark-go v0.0.0-20200522161834-8a7b2030a110 // ytt branch

0 commit comments

Comments
 (0)