Skip to content

Commit a326aa3

Browse files
authored
Merge pull request kubernetes-sigs#10474 from sbueringer/pr-conversion-gen-0.30
🌱 Bump conversion-gen to v0.30.0
2 parents bcca273 + ca09585 commit a326aa3

26 files changed

+250
-697
lines changed

Makefile

Lines changed: 46 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ OBSERVABILITY_DIR := hack/observability
7070

7171
export PATH := $(abspath $(TOOLS_BIN_DIR)):$(PATH)
7272

73-
# Set --output-base for conversion-gen if we are not within GOPATH
73+
# Set --output-dir for conversion-gen if we are not within GOPATH
7474
ifneq ($(abspath $(ROOT_DIR)),$(shell go env GOPATH)/src/sigs.k8s.io/cluster-api)
75-
CONVERSION_GEN_OUTPUT_BASE := --output-base=$(ROOT_DIR)
76-
CONVERSION_GEN_OUTPUT_BASE_CAPD := --output-base=$(ROOT_DIR)/$(CAPD_DIR)
75+
CONVERSION_GEN_OUTPUT_BASE := --output-dir=$(ROOT_DIR)
76+
CONVERSION_GEN_OUTPUT_BASE_CAPD := --output-dir=$(ROOT_DIR)/$(CAPD_DIR)
7777
else
7878
export GOPATH := $(shell go env GOPATH)
7979
endif
@@ -124,7 +124,7 @@ GOTESTSUM_BIN := gotestsum
124124
GOTESTSUM := $(abspath $(TOOLS_BIN_DIR)/$(GOTESTSUM_BIN)-$(GOTESTSUM_VER))
125125
GOTESTSUM_PKG := gotest.tools/gotestsum
126126

127-
CONVERSION_GEN_VER := v0.29.2
127+
CONVERSION_GEN_VER := v0.30.0
128128
CONVERSION_GEN_BIN := conversion-gen
129129
# We are intentionally using the binary without version suffix, to avoid the version
130130
# in generated files.
@@ -184,7 +184,7 @@ IMPORT_BOSS_PKG := k8s.io/code-generator/cmd/import-boss
184184
CONVERSION_VERIFIER_BIN := conversion-verifier
185185
CONVERSION_VERIFIER := $(abspath $(TOOLS_BIN_DIR)/$(CONVERSION_VERIFIER_BIN))
186186

187-
OPENAPI_GEN_VER := 70dd376
187+
OPENAPI_GEN_VER := dc4e619 # main branch as of 22.04.2024
188188
OPENAPI_GEN_BIN := openapi-gen
189189
# We are intentionally using the binary without version suffix, to avoid the version
190190
# in generated files.
@@ -447,90 +447,78 @@ generate-go-conversions-core: ## Run all generate-go-conversions-core-* targets
447447
generate-go-conversions-core-api: $(CONVERSION_GEN) ## Generate conversions go code for core api
448448
$(MAKE) clean-generated-conversions SRC_DIRS="./internal/apis/core/v1alpha3,./internal/apis/core/v1alpha4"
449449
$(CONVERSION_GEN) \
450-
--input-dirs=./internal/apis/core/v1alpha3 \
451-
--input-dirs=./internal/apis/core/v1alpha4 \
452-
--build-tag=ignore_autogenerated_core \
453-
--output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE) \
454-
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt
450+
--output-file=zz_generated.conversion.go $(CONVERSION_GEN_OUTPUT_BASE) \
451+
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt \
452+
./internal/apis/core/v1alpha3 \
453+
./internal/apis/core/v1alpha4
455454

456455
.PHONY: generate-go-conversions-core-exp
457456
generate-go-conversions-core-exp: $(CONVERSION_GEN) ## Generate conversions go code for core exp
458457
$(MAKE) clean-generated-conversions SRC_DIRS="./internal/apis/core/exp/v1alpha3,./internal/apis/core/exp/addons/v1alpha3,./internal/apis/core/exp/v1alpha4,./internal/apis/core/exp/addons/v1alpha4"
459458
$(CONVERSION_GEN) \
460-
--input-dirs=./internal/apis/core/exp/v1alpha3 \
461-
--input-dirs=./internal/apis/core/exp/v1alpha4 \
462-
--input-dirs=./internal/apis/core/exp/addons/v1alpha3 \
463-
--input-dirs=./internal/apis/core/exp/addons/v1alpha4 \
464-
--build-tag=ignore_autogenerated_core_exp \
465-
--extra-peer-dirs=sigs.k8s.io/cluster-api/internal/apis/core/v1alpha3 \
466-
--extra-peer-dirs=sigs.k8s.io/cluster-api/internal/apis/core/v1alpha4 \
467-
--output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE) \
468-
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt
459+
--extra-dirs=sigs.k8s.io/cluster-api/internal/apis/core/v1alpha3 \
460+
--extra-dirs=sigs.k8s.io/cluster-api/internal/apis/core/v1alpha4 \
461+
--output-file=zz_generated.conversion.go $(CONVERSION_GEN_OUTPUT_BASE) \
462+
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt \
463+
./internal/apis/core/exp/v1alpha3 \
464+
./internal/apis/core/exp/v1alpha4 \
465+
./internal/apis/core/exp/addons/v1alpha3 \
466+
./internal/apis/core/exp/addons/v1alpha4
469467

470468
.PHONY: generate-go-conversions-core-exp-ipam
471469
generate-go-conversions-core-exp-ipam: $(CONVERSION_GEN) ## Generate conversions go code for core exp IPAM
472470
$(MAKE) clean-generated-conversions SRC_DIRS="./$(EXP_DIR)/ipam/api/v1alpha1"
473471
$(CONVERSION_GEN) \
474-
--input-dirs=./$(EXP_DIR)/ipam/api/v1alpha1 \
475-
--build-tag=ignore_autogenerated_core_exp_ipam \
476-
--output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE) \
477-
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt
472+
--output-file=zz_generated.conversion.go $(CONVERSION_GEN_OUTPUT_BASE) \
473+
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt \
474+
./$(EXP_DIR)/ipam/api/v1alpha1
478475

479476
.PHONY: generate-go-conversions-core-runtime
480477
generate-go-conversions-core-runtime: $(CONVERSION_GEN) ## Generate conversions go code for core runtime
481478
$(MAKE) clean-generated-conversions SRC_DIRS="./internal/runtime/test/v1alpha1,./internal/runtime/test/v1alpha2"
482479
$(CONVERSION_GEN) \
483-
--input-dirs=./internal/runtime/test/v1alpha1 \
484-
--input-dirs=./internal/runtime/test/v1alpha2 \
485-
--build-tag=ignore_autogenerated_core_runtime \
486-
--output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE) \
487-
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt
480+
--output-file=zz_generated.conversion.go $(CONVERSION_GEN_OUTPUT_BASE) \
481+
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt \
482+
./internal/runtime/test/v1alpha1 \
483+
./internal/runtime/test/v1alpha2
488484

489485
.PHONY: generate-go-conversions-kubeadm-bootstrap
490486
generate-go-conversions-kubeadm-bootstrap: $(CONVERSION_GEN) ## Generate conversions go code for kubeadm bootstrap
491487
$(MAKE) clean-generated-conversions SRC_DIRS="./internal/apis/bootstrap/kubeadm"
492488
$(CONVERSION_GEN) \
493-
--input-dirs=./internal/apis/bootstrap/kubeadm/v1alpha3 \
494-
--input-dirs=./internal/apis/bootstrap/kubeadm/v1alpha4 \
495-
--build-tag=ignore_autogenerated_kubeadm_bootstrap \
496-
--extra-peer-dirs=sigs.k8s.io/cluster-api/internal/apis/core/v1alpha3 \
497-
--extra-peer-dirs=sigs.k8s.io/cluster-api/internal/apis/core/v1alpha4 \
498-
--output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE) \
499-
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt
489+
--output-file=zz_generated.conversion.go $(CONVERSION_GEN_OUTPUT_BASE) \
490+
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt \
491+
./internal/apis/bootstrap/kubeadm/v1alpha3 \
492+
./internal/apis/bootstrap/kubeadm/v1alpha4
500493
$(MAKE) clean-generated-conversions SRC_DIRS="./bootstrap/kubeadm/types/upstreamv1beta2,./bootstrap/kubeadm/types/upstreamv1beta3"
501494
$(CONVERSION_GEN) \
502-
--input-dirs=./bootstrap/kubeadm/types/upstreamv1beta2 \
503-
--input-dirs=./bootstrap/kubeadm/types/upstreamv1beta3 \
504-
--build-tag=ignore_autogenerated_kubeadm_types \
505-
--output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE) \
506-
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt
495+
--output-file=zz_generated.conversion.go $(CONVERSION_GEN_OUTPUT_BASE) \
496+
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt \
497+
./bootstrap/kubeadm/types/upstreamv1beta2 \
498+
./bootstrap/kubeadm/types/upstreamv1beta3
507499

508500
.PHONY: generate-go-conversions-kubeadm-control-plane
509501
generate-go-conversions-kubeadm-control-plane: $(CONVERSION_GEN) ## Generate conversions go code for kubeadm control plane
510502
$(MAKE) clean-generated-conversions SRC_DIRS="./internal/apis/controlplane/kubeadm"
511503
$(CONVERSION_GEN) \
512-
--input-dirs=./internal/apis/controlplane/kubeadm/v1alpha3 \
513-
--input-dirs=./internal/apis/controlplane/kubeadm/v1alpha4 \
514-
--build-tag=ignore_autogenerated_kubeadm_controlplane \
515-
--extra-peer-dirs=sigs.k8s.io/cluster-api/internal/apis/core/v1alpha3 \
516-
--extra-peer-dirs=sigs.k8s.io/cluster-api/internal/apis/core/v1alpha4 \
517-
--extra-peer-dirs=sigs.k8s.io/cluster-api/internal/apis/bootstrap/kubeadm/v1alpha3 \
518-
--extra-peer-dirs=sigs.k8s.io/cluster-api/internal/apis/bootstrap/kubeadm/v1alpha4 \
519-
--output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE) \
520-
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt
504+
--extra-dirs=sigs.k8s.io/cluster-api/internal/apis/core/v1alpha3 \
505+
--extra-dirs=sigs.k8s.io/cluster-api/internal/apis/core/v1alpha4 \
506+
--extra-dirs=sigs.k8s.io/cluster-api/internal/apis/bootstrap/kubeadm/v1alpha3 \
507+
--extra-dirs=sigs.k8s.io/cluster-api/internal/apis/bootstrap/kubeadm/v1alpha4 \
508+
--output-file=zz_generated.conversion.go $(CONVERSION_GEN_OUTPUT_BASE) \
509+
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt \
510+
./internal/apis/controlplane/kubeadm/v1alpha3 \
511+
./internal/apis/controlplane/kubeadm/v1alpha4
521512

522513
.PHONY: generate-go-conversions-docker-infrastructure
523514
generate-go-conversions-docker-infrastructure: $(CONVERSION_GEN) ## Generate conversions go code for docker infrastructure provider
524515
cd $(CAPD_DIR); $(CONVERSION_GEN) \
525-
--input-dirs=./api/v1alpha3 \
526-
--input-dirs=./api/v1alpha4 \
527-
--input-dirs=./$(EXP_DIR)/api/v1alpha3 \
528-
--input-dirs=./$(EXP_DIR)/api/v1alpha4 \
529-
--build-tag=ignore_autogenerated_capd \
530-
--extra-peer-dirs=sigs.k8s.io/cluster-api/internal/apis/core/v1alpha3 \
531-
--extra-peer-dirs=sigs.k8s.io/cluster-api/internal/apis/core/v1alpha4 \
532-
--output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE_CAPD) \
533-
--go-header-file=../../../hack/boilerplate/boilerplate.generatego.txt
516+
--output-file=zz_generated.conversion.go $(CONVERSION_GEN_OUTPUT_BASE_CAPD) \
517+
--go-header-file=../../../hack/boilerplate/boilerplate.generatego.txt \
518+
./api/v1alpha3 \
519+
./api/v1alpha4 \
520+
./$(EXP_DIR)/api/v1alpha3 \
521+
./$(EXP_DIR)/api/v1alpha4
534522

535523
.PHONY: generate-go-conversions-in-memory-infrastructure
536524
generate-go-conversions-in-memory-infrastructure: $(CONVERSION_GEN) ## Generate conversions go code for in-memory infrastructure provider

bootstrap/kubeadm/types/upstreamv1beta2/zz_generated.conversion.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bootstrap/kubeadm/types/upstreamv1beta2/zz_generated.deepcopy.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bootstrap/kubeadm/types/upstreamv1beta3/zz_generated.conversion.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bootstrap/kubeadm/types/upstreamv1beta3/zz_generated.deepcopy.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exp/ipam/api/v1alpha1/zz_generated.conversion.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/apis/bootstrap/kubeadm/v1alpha3/zz_generated.conversion.go

Lines changed: 4 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/apis/bootstrap/kubeadm/v1alpha4/zz_generated.conversion.go

Lines changed: 4 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/apis/controlplane/kubeadm/v1alpha3/conversion.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222

2323
bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1"
2424
controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1"
25+
bootstrapv1alpha3 "sigs.k8s.io/cluster-api/internal/apis/bootstrap/kubeadm/v1alpha3"
2526
utilconversion "sigs.k8s.io/cluster-api/util/conversion"
2627
)
2728

@@ -154,3 +155,11 @@ func Convert_v1alpha3_KubeadmControlPlaneSpec_To_v1beta1_KubeadmControlPlaneSpec
154155
out.MachineTemplate.NodeDrainTimeout = in.NodeDrainTimeout
155156
return autoConvert_v1alpha3_KubeadmControlPlaneSpec_To_v1beta1_KubeadmControlPlaneSpec(in, out, s)
156157
}
158+
159+
func Convert_v1beta1_KubeadmConfigSpec_To_v1alpha3_KubeadmConfigSpec(in *bootstrapv1.KubeadmConfigSpec, out *bootstrapv1alpha3.KubeadmConfigSpec, s apiconversion.Scope) error {
160+
return bootstrapv1alpha3.Convert_v1beta1_KubeadmConfigSpec_To_v1alpha3_KubeadmConfigSpec(in, out, s)
161+
}
162+
163+
func Convert_v1alpha3_KubeadmConfigSpec_To_v1beta1_KubeadmConfigSpec(in *bootstrapv1alpha3.KubeadmConfigSpec, out *bootstrapv1.KubeadmConfigSpec, s apiconversion.Scope) error {
164+
return bootstrapv1alpha3.Convert_v1alpha3_KubeadmConfigSpec_To_v1beta1_KubeadmConfigSpec(in, out, s)
165+
}

0 commit comments

Comments
 (0)