Skip to content

Commit aa9f47a

Browse files
authored
codegen: fix running on Go 1.23+ (#2353)
* codegen: fix running on Go 1.23+ * license * Also update common files * license
1 parent fb95213 commit aa9f47a

File tree

17 files changed

+458
-124
lines changed

17 files changed

+458
-124
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "istio build-tools",
3-
"image": "gcr.io/istio-testing/build-tools:master-a80b0e43255eca1b0094d203f57fed148e1f5cae",
3+
"image": "gcr.io/istio-testing/build-tools:master-6bfe0028e941afdae35a3c5d4374bc08e3c04153",
44
"privileged": true,
55
"remoteEnv": {
66
"USE_GKE_GCLOUD_AUTH_PLUGIN": "True",

Makefile.core.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ fixup_generated_files=\
109109
.PHONY: generate-k8s-client
110110
generate-k8s-client:
111111
# generate kube api type wrappers for istio types
112-
@KUBETYPE_GOLANG_PROTOBUF=true $(kubetype_gen) --input-dirs $(kube_istio_source_packages) --output-package $(kube_api_base_package) -h $(kube_go_header_text)
112+
# TODO(https://github.com/istio/istio/issues/54831) do not depend on gotypesalias=0 for this to work
113+
@GODEBUG=gotypesalias=0 $(kubetype_gen) --input-dirs $(kube_istio_source_packages) --output-package $(kube_api_base_package) -h $(kube_go_header_text)
113114
@$(move_generated)
114115
# generate deepcopy for kube api types
115116
@$(deepcopy_gen) --input-dirs $(kube_api_packages) -O zz_generated.deepcopy -h $(kube_go_header_text)

common/.commonfiles.sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5a915b1617d9d91bce8e3a6c64ab0f9ae4e97ca1
1+
4a811c922d5823525dc271fa6defd1978bf73286

common/config/license-lint.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,11 @@ allowlisted_modules:
132132
# gonum.org/v1/gonum/graph/formats/rdf/testdata/LICENSE.md
133133
- gonum.org/v1/gonum
134134

135+
# BSD 3-clause: https://github.com/go-inf/inf/blob/v0.9.1/LICENSE
136+
- gopkg.in/inf.v0
137+
138+
# BSD 3-clause: https://github.com/go-git/gcfg/blob/main/LICENSE
139+
- github.com/go-git/gcfg
140+
141+
# Apache 2.0
142+
- github.com/aws/smithy-go

common/scripts/kind_provisioner.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ set -x
3535
DEFAULT_KIND_IMAGE="gcr.io/istio-testing/kind-node:v1.32.0"
3636

3737
# the default kind cluster should be ipv4 if not otherwise specified
38-
IP_FAMILY="${IP_FAMILY:-ipv4}"
38+
KIND_IP_FAMILY="${KIND_IP_FAMILY:-ipv4}"
3939

4040
# COMMON_SCRIPTS contains the directory this file is in.
4141
COMMON_SCRIPTS=$(dirname "${BASH_SOURCE:-$0}")
@@ -147,7 +147,7 @@ function setup_kind_cluster_retry() {
147147
# 1. NAME: Name of the Kind cluster (optional)
148148
# 2. IMAGE: Node image used by KinD (optional)
149149
# 3. CONFIG: KinD cluster configuration YAML file. If not specified then DEFAULT_CLUSTER_YAML is used
150-
# 4. NOMETALBINSTALL: Dont install matllb if set.
150+
# 4. NOMETALBINSTALL: Dont install metalb if set.
151151
# This function returns 0 when everything goes well, or 1 otherwise
152152
# If Kind cluster was already created then it would be cleaned up in case of errors
153153
function setup_kind_cluster() {
@@ -186,11 +186,20 @@ function setup_kind_cluster() {
186186

187187
# Create KinD cluster
188188
if ! (yq eval "${CONFIG}" --expression ".networking.disableDefaultCNI = ${KIND_DISABLE_CNI}" \
189-
--expression ".networking.ipFamily = \"${IP_FAMILY}\"" | \
189+
--expression ".networking.ipFamily = \"${KIND_IP_FAMILY}\"" | \
190190
kind create cluster --name="${NAME}" -v4 --retain --image "${IMAGE}" ${KIND_WAIT_FLAG:+"$KIND_WAIT_FLAG"} --config -); then
191191
echo "Could not setup KinD environment. Something wrong with KinD setup. Exporting logs."
192192
return 9
193+
# kubectl config set clusters.kind-istio-testing.server https://istio-testing-control-plane:6443
193194
fi
195+
196+
if [[ -n "${DEVCONTAINER}" ]]; then
197+
# identify our docker container id using proc and regex
198+
containerid=$(grep 'resolv.conf' /proc/self/mountinfo | sed 's/.*\/docker\/containers\/\([0-9a-f]*\).*/\1/')
199+
docker network connect kind "$containerid"
200+
kind export kubeconfig --name="${NAME}" --internal
201+
fi
202+
194203
# Workaround kind issue causing taints to not be removed in 1.24
195204
kubectl taint nodes "${NAME}"-control-plane node-role.kubernetes.io/control-plane- 2>/dev/null || true
196205

@@ -230,7 +239,7 @@ function setup_kind_cluster() {
230239
# https://github.com/coredns/coredns/issues/2494#issuecomment-457215452
231240
# CoreDNS should handle those domains and answer with NXDOMAIN instead of SERVFAIL
232241
# otherwise pods stops trying to resolve the domain.
233-
if [ "${IP_FAMILY}" = "ipv6" ] || [ "${IP_FAMILY}" = "dual" ]; then
242+
if [ "${KIND_IP_FAMILY}" = "ipv6" ] || [ "${KIND_IP_FAMILY}" = "dual" ]; then
234243
# Get the current config
235244
original_coredns=$(kubectl get -oyaml -n=kube-system configmap/coredns)
236245
echo "Original CoreDNS config:"
@@ -267,14 +276,14 @@ function cleanup_kind_clusters() {
267276
# setup_kind_clusters sets up a given number of kind clusters with given topology
268277
# as specified in cluster topology configuration file.
269278
# 1. IMAGE = docker image used as node by KinD
270-
# 2. IP_FAMILY = either ipv4 or ipv6
279+
# 2. KIND_IP_FAMILY = either ipv4 or ipv6 or dual
271280
#
272281
# NOTE: Please call load_cluster_topology before calling this method as it expects
273282
# cluster topology information to be loaded in advance
274283
function setup_kind_clusters() {
275284
IMAGE="${1:-"${DEFAULT_KIND_IMAGE}"}"
276285
KUBECONFIG_DIR="${ARTIFACTS:-$(mktemp -d)}/kubeconfig"
277-
IP_FAMILY="${2:-ipv4}"
286+
KIND_IP_FAMILY="${2:-ipv4}"
278287

279288
check_default_cluster_yaml
280289

common/scripts/setup_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ fi
7575
TOOLS_REGISTRY_PROVIDER=${TOOLS_REGISTRY_PROVIDER:-gcr.io}
7676
PROJECT_ID=${PROJECT_ID:-istio-testing}
7777
if [[ "${IMAGE_VERSION:-}" == "" ]]; then
78-
IMAGE_VERSION=master-a80b0e43255eca1b0094d203f57fed148e1f5cae
78+
IMAGE_VERSION=master-6bfe0028e941afdae35a3c5d4374bc08e3c04153
7979
fi
8080
if [[ "${IMAGE_NAME:-}" == "" ]]; then
8181
IMAGE_NAME=build-tools

go.mod

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
11
module istio.io/client-go
22

3-
go 1.22.0
4-
5-
toolchain go1.22.3
3+
go 1.23.0
64

75
require (
8-
istio.io/api v1.24.0-alpha.0.0.20250103213058-f293e9c39285
9-
k8s.io/apimachinery v0.30.0
10-
k8s.io/client-go v0.29.0
11-
sigs.k8s.io/structured-merge-diff/v4 v4.4.1
6+
istio.io/api v1.25.0-alpha.0.0.20250122191259-d8ef56f50c37
7+
k8s.io/apimachinery v0.32.1
8+
k8s.io/client-go v0.32.1
9+
sigs.k8s.io/structured-merge-diff/v4 v4.5.0
1210
)
1311

1412
require (
15-
github.com/davecgh/go-spew v1.1.1 // indirect
13+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
1614
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
17-
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
18-
github.com/go-logr/logr v1.4.1 // indirect
19-
github.com/go-openapi/jsonpointer v0.19.6 // indirect
15+
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
16+
github.com/go-logr/logr v1.4.2 // indirect
17+
github.com/go-openapi/jsonpointer v0.21.0 // indirect
2018
github.com/go-openapi/jsonreference v0.20.2 // indirect
21-
github.com/go-openapi/swag v0.22.3 // indirect
19+
github.com/go-openapi/swag v0.23.0 // indirect
2220
github.com/gogo/protobuf v1.3.2 // indirect
2321
github.com/golang/protobuf v1.5.4 // indirect
2422
github.com/google/gnostic-models v0.6.8 // indirect
2523
github.com/google/go-cmp v0.6.0 // indirect
2624
github.com/google/gofuzz v1.2.0 // indirect
27-
github.com/google/uuid v1.3.0 // indirect
28-
github.com/imdario/mergo v0.3.6 // indirect
25+
github.com/google/uuid v1.6.0 // indirect
2926
github.com/josharian/intern v1.0.0 // indirect
3027
github.com/json-iterator/go v1.1.12 // indirect
3128
github.com/mailru/easyjson v0.7.7 // indirect
@@ -34,22 +31,22 @@ require (
3431
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
3532
github.com/pkg/errors v0.9.1 // indirect
3633
github.com/spf13/pflag v1.0.5 // indirect
34+
github.com/x448/float16 v0.8.4 // indirect
3735
golang.org/x/net v0.32.0 // indirect
38-
golang.org/x/oauth2 v0.10.0 // indirect
36+
golang.org/x/oauth2 v0.23.0 // indirect
3937
golang.org/x/sys v0.28.0 // indirect
4038
golang.org/x/term v0.27.0 // indirect
4139
golang.org/x/text v0.21.0 // indirect
42-
golang.org/x/time v0.3.0 // indirect
43-
google.golang.org/appengine v1.6.7 // indirect
40+
golang.org/x/time v0.7.0 // indirect
4441
google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect
4542
google.golang.org/protobuf v1.36.0 // indirect
43+
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
4644
gopkg.in/inf.v0 v0.9.1 // indirect
47-
gopkg.in/yaml.v2 v2.4.0 // indirect
4845
gopkg.in/yaml.v3 v3.0.1 // indirect
49-
k8s.io/api v0.30.0 // indirect
50-
k8s.io/klog/v2 v2.120.1 // indirect
51-
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
52-
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
53-
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
54-
sigs.k8s.io/yaml v1.3.0 // indirect
46+
k8s.io/api v0.32.1 // indirect
47+
k8s.io/klog/v2 v2.130.1 // indirect
48+
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
49+
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
50+
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
51+
sigs.k8s.io/yaml v1.4.0 // indirect
5552
)

0 commit comments

Comments
 (0)