Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
937afce
Bump CAPI in tests to main
chrischdi May 15, 2025
d575656
Bump to Go 1.24 and CAPI Go dependencies
chrischdi May 15, 2025
85879f9
Use deprecated conditions and patch packages
chrischdi May 15, 2025
495e91e
rename clusterv1 v1beta1 imports to clusterv1beta1
chrischdi May 15, 2025
fdeeb87
controllers: use deprecated paused pkg
chrischdi May 15, 2025
058f61b
part1: use clusterv1.Cluster and Machine
chrischdi May 15, 2025
0e7e522
realias deprecated condition package imports
chrischdi May 15, 2025
0994237
controlplanev1 update to v1beta2 except test-extension
chrischdi May 15, 2025
9d3f4fc
migrate Cluster .status.infrastructureReady to .status.initialization…
chrischdi May 15, 2025
fdf20b1
migrate watches to v1beta2 cluster and machine and fixup predicate
chrischdi May 15, 2025
d873806
controllers: fix check on cluster v1beta1 condition
chrischdi May 15, 2025
17aeede
test: vcsim: fixup clusterv1 to v1beta2
chrischdi May 15, 2025
8aae577
some more cluster/machine to v1beta2
chrischdi May 15, 2025
74993b3
fixes
chrischdi May 16, 2025
d4b809a
fixup printf findings
chrischdi May 16, 2025
9216b63
fixes
chrischdi May 16, 2025
e553e6a
fix using local replace for tests
chrischdi May 16, 2025
7672e9f
Bump CAPI to 071d769879ff13ae358c82a6d267da97e13f05f6
chrischdi May 19, 2025
72470dc
fixes
chrischdi May 19, 2025
1a15b57
e2e: migrate main templates to v1beta2
chrischdi May 20, 2025
038d343
e2e: add v1.11 metadata.yaml
chrischdi May 20, 2025
16403fe
fixup capi metadata
chrischdi May 23, 2025
72a4130
fixup e2e capi metadata
chrischdi May 23, 2025
156959c
vcsim: reconcile based on v1beta1 for compatibility to clusterctl upg…
chrischdi May 23, 2025
acf4708
vsphere.yaml: fix contract for CAPI and bump to 19th may
chrischdi May 23, 2025
ab747fd
e2e: fix scheme and target contract in upgrade tests
chrischdi May 23, 2025
e22c091
bump capi manifests for runtimesdk v1beta2
chrischdi May 23, 2025
82db1d4
Bump CAPI to main
chrischdi May 23, 2025
24bf795
sed s "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta2" "sigs.k…
chrischdi May 23, 2025
b223945
sed s "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k…
chrischdi May 23, 2025
133aef2
sed s "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta2" "sig…
chrischdi May 23, 2025
4d78a0b
sed s "sigs.k8s.io/cluster-api/api/v1beta2" "sigs.k8s.io/cluster-api/…
chrischdi May 23, 2025
32ca210
sed s "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/…
chrischdi May 23, 2025
9b4f34d
sed s "sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1" "sigs.k8s.io/clu…
chrischdi May 23, 2025
2d38559
sed s "sigs.k8s.io/cluster-api/exp/api/v1beta2" "sigs.k8s.io/cluster-…
chrischdi May 23, 2025
401894b
.golangci.yml adjustment and expv1 -> clusterv1 renaming
chrischdi May 23, 2025
a6db8f5
sed s "sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1" "sigs.k8s.io/cl…
chrischdi May 23, 2025
70033fe
sed s "sigs.k8s.io/cluster-api/exp/runtime/hooks/api/v1alpha1" "sigs.…
chrischdi May 23, 2025
38a32f4
sed s "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sig…
chrischdi May 23, 2025
1e3afc9
make generate-modules
chrischdi May 23, 2025
0bc1f04
make lint-fix
chrischdi May 23, 2025
f72c50f
test: bump to ipam v1beta1
chrischdi May 23, 2025
86aa9ee
lint: exclude deprecation messages
chrischdi May 23, 2025
e04c86f
make lint-fix
chrischdi May 23, 2025
2d8eb81
fixup cc.spec.class removal
chrischdi May 23, 2025
ba43dae
fixup imports ipamv1beta1
chrischdi May 23, 2025
9d294bd
e2e: use ipam v1beta2
chrischdi May 23, 2025
cf1c36e
run generate
chrischdi May 23, 2025
73e262b
test-extension: fail mutation on unknown objects
chrischdi May 26, 2025
7e2c71d
packaging: use addons v1beta2
chrischdi May 26, 2025
62e4f6f
make exclude for controlplanev1beta1 more specific
chrischdi May 26, 2025
071efc3
make exclude for bootstrapv1beta1 more specific
chrischdi May 26, 2025
00d546b
make lint excludes more specific
chrischdi May 26, 2025
51c5929
Bump CAPI and manifests to nightly_main_20250526
chrischdi May 27, 2025
9582930
exclude corev1.Endpoints deprecation
chrischdi May 27, 2025
5309df0
make test extension fail on unknown types
chrischdi May 27, 2025
f5ccaa3
use randfill instead of gofuzz
chrischdi May 27, 2025
b9a98bb
Fixup import
chrischdi May 27, 2025
4b3f822
Bump controller-gen, setup-envtest and conversion-gen
chrischdi May 27, 2025
9addabc
fixes
chrischdi May 27, 2025
00c07a3
fix
chrischdi May 27, 2025
2d89aa5
test-extension: patch v1beta2
chrischdi May 27, 2025
4899d07
Bump CAPI manifests
chrischdi May 27, 2025
66b8717
fixup remove usage of sigs.k8s.io/cluster-api/util/conditions/depreca…
chrischdi May 27, 2025
03872f2
review fixes
chrischdi May 27, 2025
02f19c3
fixup .golangci.yml
chrischdi May 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 33 additions & 14 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "2"
run:
timeout: 10m
go: "1.23"
go: "1.24"
allow-parallel-runners: true
linters:
default: none
Expand Down Expand Up @@ -117,23 +117,30 @@ linters:
- pkg: github.com/vmware-tanzu/nsx-operator/pkg/apis/vpc/v1alpha1
alias: nsxvpcv1
# CABPK
- pkg: sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1
- pkg: sigs.k8s.io/cluster-api/api/bootstrap/kubeadm/v1beta2
alias: bootstrapv1
- pkg: sigs.k8s.io/cluster-api/api/bootstrap/kubeadm/v1beta1
alias: bootstrapv1beta1
# KCP
- pkg: sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1
- pkg: sigs.k8s.io/cluster-api/api/controlplane/kubeadm/v1beta2
alias: controlplanev1
# CAPI
- pkg: sigs.k8s.io/cluster-api/api/v1beta1
- pkg: sigs.k8s.io/cluster-api/api/core/v1beta2
alias: clusterv1
# CAPI exp
- pkg: sigs.k8s.io/cluster-api/exp/api/v1beta1
alias: expv1
# CAPI exp addons
- pkg: sigs.k8s.io/cluster-api/api/addons/v1beta1
- pkg: sigs.k8s.io/cluster-api/api/core/v1beta1
alias: clusterv1beta1
- pkg: sigs.k8s.io/cluster-api/util/deprecated/v1beta1/conditions
alias: deprecatedconditions
- pkg: sigs.k8s.io/cluster-api/util/deprecated/v1beta1/conditions/v1beta2
alias: deprecatedv1beta2conditions
# CAPI addons
- pkg: sigs.k8s.io/cluster-api/api/addons/v1beta2
alias: addonsv1
# CAPI IPAM
- pkg: sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1
- pkg: sigs.k8s.io/cluster-api/api/ipam/v1beta2
alias: ipamv1
- pkg: sigs.k8s.io/cluster-api/api/ipam/v1beta1
alias: ipamv1beta1
nolintlint:
require-specific: true
allow-unused: false
Expand Down Expand Up @@ -195,6 +202,22 @@ linters:
- linters:
- staticcheck
text: 'SA1019: "sigs.k8s.io/cluster-api-provider-vsphere/apis/(v1alpha3|v1alpha4)" is deprecated: This package will be removed in one of the next releases.'
- linters:
- staticcheck
text: 'SA1019: "sigs.k8s.io/cluster-api/api/core/v1beta1" is deprecated: This package is deprecated and is going to be removed when support for v1beta1 will be dropped.'
# CAPV Govmomi aggregates from IPAddressClaims to v1beta1 conditions
- linters:
- staticcheck
text: 'SA1019: "sigs.k8s.io/cluster-api/api/ipam/v1beta1" is deprecated: This package is deprecated and is going to be removed when support for v1beta1 will be dropped.'
- linters:
- staticcheck
text: 'SA1019: "sigs.k8s.io/cluster-api/util/deprecated/v1beta1/.*" is deprecated'
- linters:
- staticcheck
text: 'SA1019: corev1.Endpoints is deprecated: This API is deprecated in v1.33\+. Use discoveryv1.EndpointSlice.'
- linters:
- staticcheck
text: 'SA1019: corev1.EndpointSubset is deprecated: This API is deprecated in v1.33\+.'
- linters:
- revive
text: 'exported: exported method .*\.(Reconcile|SetupWithManager|SetupWebhookWithManager) should have comment or be unexported'
Expand Down Expand Up @@ -304,10 +327,6 @@ linters:
- staticcheck
path: ^(apis/(v1alpha3|v1alpha4)\/.*)\.go$
text: ST1021|ST1020
# Ignore non-constant format string in call to condition utils
- linters:
- govet
text: non-constant format string in call to sigs\.k8s\.io\/cluster-api\/util\/conditions\.
- linters:
- goconst
path: (.+)_test\.go
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ SHELL:=/usr/bin/env bash
#
# Go.
#
GO_VERSION ?= 1.23.8
GO_DIRECTIVE_VERSION ?= 1.23.0
GO_VERSION ?= 1.24.3
GO_DIRECTIVE_VERSION ?= 1.24.0
GO_CONTAINER_IMAGE ?= docker.io/library/golang:$(GO_VERSION)

# Ensure correct toolchain is used
Expand Down Expand Up @@ -113,12 +113,12 @@ KUSTOMIZE_BIN := kustomize
KUSTOMIZE := $(abspath $(TOOLS_BIN_DIR)/$(KUSTOMIZE_BIN)-$(KUSTOMIZE_VER))
KUSTOMIZE_PKG := sigs.k8s.io/kustomize/kustomize/v4

SETUP_ENVTEST_VER := release-0.20
SETUP_ENVTEST_VER := release-0.21
SETUP_ENVTEST_BIN := setup-envtest
SETUP_ENVTEST := $(abspath $(TOOLS_BIN_DIR)/$(SETUP_ENVTEST_BIN)-$(SETUP_ENVTEST_VER))
SETUP_ENVTEST_PKG := sigs.k8s.io/controller-runtime/tools/setup-envtest

CONTROLLER_GEN_VER := v0.17.0
CONTROLLER_GEN_VER := v0.18.0
CONTROLLER_GEN_BIN := controller-gen
CONTROLLER_GEN := $(abspath $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER))
CONTROLLER_GEN_PKG := sigs.k8s.io/controller-tools/cmd/controller-gen
Expand All @@ -128,7 +128,7 @@ GOTESTSUM_BIN := gotestsum
GOTESTSUM := $(abspath $(TOOLS_BIN_DIR)/$(GOTESTSUM_BIN)-$(GOTESTSUM_VER))
GOTESTSUM_PKG := gotest.tools/gotestsum

CONVERSION_GEN_VER := v0.32.0
CONVERSION_GEN_VER := v0.33.0
CONVERSION_GEN_BIN := conversion-gen
# We are intentionally using the binary without version suffix, to avoid the version
# in generated files.
Expand Down Expand Up @@ -190,7 +190,7 @@ IMPORT_BOSS_VER := v0.28.1
IMPORT_BOSS := $(abspath $(TOOLS_BIN_DIR)/$(IMPORT_BOSS_BIN))
IMPORT_BOSS_PKG := k8s.io/code-generator/cmd/import-boss

CAPI_HACK_TOOLS_VER := 647a1b741bc86dd759583a44b50a3ba8dbd326c4 # Note: this the commit ID of CAPI v1.10.1
CAPI_HACK_TOOLS_VER := 071d769879ff13ae358c82a6d267da97e13f05f6 # Note: this the commit ID of CAPI on main at 19th May 2025

BOSKOSCTL_BIN := boskosctl
BOSKOSCTL := $(abspath $(TOOLS_BIN_DIR)/$(BOSKOSCTL_BIN))
Expand Down
24 changes: 12 additions & 12 deletions apis/v1alpha3/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ package v1alpha3
import (
"testing"

fuzz "github.com/google/gofuzz"
. "github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/api/apitesting/fuzzer"
"k8s.io/apimachinery/pkg/runtime"
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
utilconversion "sigs.k8s.io/cluster-api/util/conversion"
"sigs.k8s.io/randfill"

infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1"
)
Expand Down Expand Up @@ -67,16 +67,16 @@ func TestFuzzyConversion(t *testing.T) {

func overrideVSphereClusterDeprecatedFieldsFuncs(runtimeserializer.CodecFactory) []interface{} {
return []interface{}{
func(vsphereClusterSpec *VSphereClusterSpec, _ fuzz.Continue) {
func(vsphereClusterSpec *VSphereClusterSpec, _ randfill.Continue) {
vsphereClusterSpec.CloudProviderConfiguration = CPIConfig{}
},
}
}

func overrideVSphereClusterSpecFieldsFuncs(runtimeserializer.CodecFactory) []interface{} {
return []interface{}{
func(in *infrav1.VSphereClusterSpec, c fuzz.Continue) {
c.FuzzNoCustom(in)
func(in *infrav1.VSphereClusterSpec, c randfill.Continue) {
c.FillNoCustom(in)
in.ClusterModules = nil
in.FailureDomainSelector = nil
in.DisableClusterModule = false
Expand All @@ -86,8 +86,8 @@ func overrideVSphereClusterSpecFieldsFuncs(runtimeserializer.CodecFactory) []int

func overrideVSphereClusterStatusFieldsFuncs(runtimeserializer.CodecFactory) []interface{} {
return []interface{}{
func(in *infrav1.VSphereClusterStatus, c fuzz.Continue) {
c.FuzzNoCustom(in)
func(in *infrav1.VSphereClusterStatus, c randfill.Continue) {
c.FillNoCustom(in)
in.VCenterVersion = ""
},
}
Expand All @@ -99,8 +99,8 @@ func CustomObjectMetaFuzzFunc(runtimeserializer.CodecFactory) []interface{} {
}
}

func CustomObjectMetaFuzzer(in *ObjectMeta, c fuzz.Continue) {
c.FuzzNoCustom(in)
func CustomObjectMetaFuzzer(in *ObjectMeta, c randfill.Continue) {
c.FillNoCustom(in)

// These fields have been removed in v1alpha4
// data is going to be lost, so we're forcing zero values here.
Expand All @@ -117,17 +117,17 @@ func CustomNewFieldFuzzFunc(runtimeserializer.CodecFactory) []interface{} {
}
}

func CustomSpecNewFieldFuzzer(in *infrav1.VirtualMachineCloneSpec, c fuzz.Continue) {
c.FuzzNoCustom(in)
func CustomSpecNewFieldFuzzer(in *infrav1.VirtualMachineCloneSpec, c randfill.Continue) {
c.FillNoCustom(in)

in.PciDevices = nil
in.AdditionalDisksGiB = nil
in.OS = ""
in.HardwareVersion = ""
}

func CustomStatusNewFieldFuzzer(in *infrav1.VSphereVMStatus, c fuzz.Continue) {
c.FuzzNoCustom(in)
func CustomStatusNewFieldFuzzer(in *infrav1.VSphereVMStatus, c randfill.Continue) {
c.FillNoCustom(in)

in.Host = ""
in.ModuleUUID = nil
Expand Down
10 changes: 5 additions & 5 deletions apis/v1alpha3/vspheremachinetemplate_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"unsafe"

apiconversion "k8s.io/apimachinery/pkg/conversion"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1"
utilconversion "sigs.k8s.io/cluster-api/util/conversion"
"sigs.k8s.io/controller-runtime/pkg/conversion"

Expand Down Expand Up @@ -79,14 +79,14 @@ func (dst *VSphereMachineTemplateList) ConvertFrom(srcRaw conversion.Hub) error
return Convert_v1beta1_VSphereMachineTemplateList_To_v1alpha3_VSphereMachineTemplateList(src, dst, nil)
}

func Convert_v1alpha3_ObjectMeta_To_v1beta1_ObjectMeta(in *ObjectMeta, out *clusterv1.ObjectMeta, s apiconversion.Scope) error {
func Convert_v1alpha3_ObjectMeta_To_v1beta1_ObjectMeta(in *ObjectMeta, out *clusterv1beta1.ObjectMeta, s apiconversion.Scope) error {
// wrapping the conversion func to avoid having compile errors due to compileErrorOnMissingConversion()
// more details at https://github.com/kubernetes/kubernetes/issues/98380
return autoConvert_v1alpha3_ObjectMeta_To_v1beta1_ObjectMeta(in, out, s)
}

// autoConvert_v1alpha3_ObjectMeta_To_v1beta1_ObjectMeta was copied over from CAPI because it is now internal there.
func autoConvert_v1alpha3_ObjectMeta_To_v1beta1_ObjectMeta(in *ObjectMeta, out *clusterv1.ObjectMeta, s apiconversion.Scope) error {
func autoConvert_v1alpha3_ObjectMeta_To_v1beta1_ObjectMeta(in *ObjectMeta, out *clusterv1beta1.ObjectMeta, s apiconversion.Scope) error {
// WARNING: in.Name requires manual conversion: does not exist in peer-type
// WARNING: in.GenerateName requires manual conversion: does not exist in peer-type
// WARNING: in.Namespace requires manual conversion: does not exist in peer-type
Expand All @@ -96,14 +96,14 @@ func autoConvert_v1alpha3_ObjectMeta_To_v1beta1_ObjectMeta(in *ObjectMeta, out *
return nil
}

func Convert_v1beta1_ObjectMeta_To_v1alpha3_ObjectMeta(in *clusterv1.ObjectMeta, out *ObjectMeta, s apiconversion.Scope) error {
func Convert_v1beta1_ObjectMeta_To_v1alpha3_ObjectMeta(in *clusterv1beta1.ObjectMeta, out *ObjectMeta, s apiconversion.Scope) error {
// wrapping the conversion func to avoid having compile errors due to compileErrorOnMissingConversion()
// more details at https://github.com/kubernetes/kubernetes/issues/98380
return autoConvert_v1beta1_ObjectMeta_To_v1alpha3_ObjectMeta(in, out, s)
}

// autoConvert_v1beta1_ObjectMeta_To_v1alpha3_ObjectMeta was copied over from CAPI because it is now internal there.
func autoConvert_v1beta1_ObjectMeta_To_v1alpha3_ObjectMeta(in *clusterv1.ObjectMeta, out *ObjectMeta, s apiconversion.Scope) error {
func autoConvert_v1beta1_ObjectMeta_To_v1alpha3_ObjectMeta(in *clusterv1beta1.ObjectMeta, out *ObjectMeta, s apiconversion.Scope) error {
out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels))
out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations))
return nil
Expand Down
24 changes: 12 additions & 12 deletions apis/v1alpha3/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions apis/v1alpha4/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ package v1alpha4
import (
"testing"

fuzz "github.com/google/gofuzz"
. "github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/api/apitesting/fuzzer"
"k8s.io/apimachinery/pkg/runtime"
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
utilconversion "sigs.k8s.io/cluster-api/util/conversion"
"sigs.k8s.io/randfill"

infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1"
)
Expand Down Expand Up @@ -66,8 +66,8 @@ func TestFuzzyConversion(t *testing.T) {

func overrideVSphereClusterSpecFieldsFuncs(runtimeserializer.CodecFactory) []interface{} {
return []interface{}{
func(in *infrav1.VSphereClusterSpec, c fuzz.Continue) {
c.FuzzNoCustom(in)
func(in *infrav1.VSphereClusterSpec, c randfill.Continue) {
c.FillNoCustom(in)
in.ClusterModules = nil
in.FailureDomainSelector = nil
in.DisableClusterModule = false
Expand All @@ -77,8 +77,8 @@ func overrideVSphereClusterSpecFieldsFuncs(runtimeserializer.CodecFactory) []int

func overrideVSphereClusterStatusFieldsFuncs(runtimeserializer.CodecFactory) []interface{} {
return []interface{}{
func(in *infrav1.VSphereClusterStatus, c fuzz.Continue) {
c.FuzzNoCustom(in)
func(in *infrav1.VSphereClusterStatus, c randfill.Continue) {
c.FillNoCustom(in)
in.VCenterVersion = ""
},
}
Expand All @@ -91,17 +91,17 @@ func CustomNewFieldFuzzFunc(runtimeserializer.CodecFactory) []interface{} {
}
}

func CustomSpecNewFieldFuzzer(in *infrav1.VirtualMachineCloneSpec, c fuzz.Continue) {
c.FuzzNoCustom(in)
func CustomSpecNewFieldFuzzer(in *infrav1.VirtualMachineCloneSpec, c randfill.Continue) {
c.FillNoCustom(in)

in.PciDevices = nil
in.AdditionalDisksGiB = nil
in.OS = ""
in.HardwareVersion = ""
}

func CustomStatusNewFieldFuzzer(in *infrav1.VSphereVMStatus, c fuzz.Continue) {
c.FuzzNoCustom(in)
func CustomStatusNewFieldFuzzer(in *infrav1.VSphereVMStatus, c randfill.Continue) {
c.FillNoCustom(in)

in.Host = ""
in.ModuleUUID = nil
Expand Down
Loading
Loading