Skip to content

⚠️ Bump to controller-runtime v0.21 / controller-tools v0.18 / k8s.io/* v0.33 / move to randfill #12191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ linters:
- linters:
- staticcheck
text: 'SA1019: .*\.Deprecated\.V1Beta1.* is deprecated'
# CR v0.21 deprecated Result.Requeue, will be fixed incrementally and tracked via https://github.com/kubernetes-sigs/cluster-api/issues/12272
- linters:
- staticcheck
text: 'SA1019: .*(res|result|i|j)\.Requeue is deprecated: Use `RequeueAfter` instead'
- linters:
- revive
text: 'exported: exported method .*\.(Reconcile|SetupWithManager|SetupWebhookWithManager) should have comment or be unexported'
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ KUSTOMIZE_BIN := kustomize
KUSTOMIZE := $(abspath $(TOOLS_BIN_DIR)/$(KUSTOMIZE_BIN)-$(KUSTOMIZE_VER))
KUSTOMIZE_PKG := sigs.k8s.io/kustomize/kustomize/v5

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.3
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 Down
10 changes: 5 additions & 5 deletions api/addons/v1beta1/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"reflect"
"testing"

fuzz "github.com/google/gofuzz"
"k8s.io/apimachinery/pkg/api/apitesting/fuzzer"
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
"sigs.k8s.io/randfill"

addonsv1 "sigs.k8s.io/cluster-api/api/addons/v1beta2"
utilconversion "sigs.k8s.io/cluster-api/util/conversion"
Expand All @@ -51,8 +51,8 @@ func ClusterResourceSetFuzzFuncs(_ runtimeserializer.CodecFactory) []interface{}
}
}

func hubClusterResourceSetStatus(in *addonsv1.ClusterResourceSetStatus, c fuzz.Continue) {
c.FuzzNoCustom(in)
func hubClusterResourceSetStatus(in *addonsv1.ClusterResourceSetStatus, c randfill.Continue) {
c.FillNoCustom(in)
// Drop empty structs with only omit empty fields.
if in.Deprecated != nil {
if in.Deprecated.V1Beta1 == nil || reflect.DeepEqual(in.Deprecated.V1Beta1, &addonsv1.ClusterResourceSetV1Beta1DeprecatedStatus{}) {
Expand All @@ -61,8 +61,8 @@ func hubClusterResourceSetStatus(in *addonsv1.ClusterResourceSetStatus, c fuzz.C
}
}

func spokeClusterResourceSetStatus(in *ClusterResourceSetStatus, c fuzz.Continue) {
c.FuzzNoCustom(in)
func spokeClusterResourceSetStatus(in *ClusterResourceSetStatus, c randfill.Continue) {
c.FillNoCustom(in)
// Drop empty structs with only omit empty fields.
if in.V1Beta2 != nil {
if reflect.DeepEqual(in.V1Beta2, &ClusterResourceSetV1Beta2Status{}) {
Expand Down
14 changes: 7 additions & 7 deletions api/bootstrap/kubeadm/v1beta1/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"reflect"
"testing"

fuzz "github.com/google/gofuzz"
"k8s.io/apimachinery/pkg/api/apitesting/fuzzer"
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
"sigs.k8s.io/randfill"

bootstrapv1 "sigs.k8s.io/cluster-api/api/bootstrap/kubeadm/v1beta2"
utilconversion "sigs.k8s.io/cluster-api/util/conversion"
Expand Down Expand Up @@ -53,8 +53,8 @@ func KubeadmConfigFuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} {
}
}

func hubKubeadmConfigStatus(in *bootstrapv1.KubeadmConfigStatus, c fuzz.Continue) {
c.FuzzNoCustom(in)
func hubKubeadmConfigStatus(in *bootstrapv1.KubeadmConfigStatus, c randfill.Continue) {
c.FillNoCustom(in)
// Always create struct with at least one mandatory fields.
if in.Deprecated == nil {
in.Deprecated = &bootstrapv1.KubeadmConfigDeprecatedStatus{}
Expand All @@ -71,15 +71,15 @@ func hubKubeadmConfigStatus(in *bootstrapv1.KubeadmConfigStatus, c fuzz.Continue
}
}

func spokeKubeadmConfigSpec(in *KubeadmConfigSpec, c fuzz.Continue) {
c.FuzzNoCustom(in)
func spokeKubeadmConfigSpec(in *KubeadmConfigSpec, c randfill.Continue) {
c.FillNoCustom(in)

// Drop UseExperimentalRetryJoin as we intentionally don't preserve it.
in.UseExperimentalRetryJoin = false
}

func spokeKubeadmConfigStatus(in *KubeadmConfigStatus, c fuzz.Continue) {
c.FuzzNoCustom(in)
func spokeKubeadmConfigStatus(in *KubeadmConfigStatus, c randfill.Continue) {
c.FillNoCustom(in)
// Drop empty structs with only omit empty fields.
if in.V1Beta2 != nil {
if reflect.DeepEqual(in.V1Beta2, &KubeadmConfigV1Beta2Status{}) {
Expand Down
14 changes: 7 additions & 7 deletions api/controlplane/kubeadm/v1beta1/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import (
"reflect"
"testing"

fuzz "github.com/google/gofuzz"
"k8s.io/apimachinery/pkg/api/apitesting/fuzzer"
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/utils/ptr"
"sigs.k8s.io/randfill"

bootstrapv1beta1 "sigs.k8s.io/cluster-api/api/bootstrap/kubeadm/v1beta1"
controlplanev1 "sigs.k8s.io/cluster-api/api/controlplane/kubeadm/v1beta2"
Expand Down Expand Up @@ -55,8 +55,8 @@ func KubeadmControlPlaneFuzzFuncs(_ runtimeserializer.CodecFactory) []interface{
}
}

func hubKubeadmControlPlaneStatus(in *controlplanev1.KubeadmControlPlaneStatus, c fuzz.Continue) {
c.FuzzNoCustom(in)
func hubKubeadmControlPlaneStatus(in *controlplanev1.KubeadmControlPlaneStatus, c randfill.Continue) {
c.FillNoCustom(in)
// Always create struct with at least one mandatory fields.
if in.Deprecated == nil {
in.Deprecated = &controlplanev1.KubeadmControlPlaneDeprecatedStatus{}
Expand All @@ -79,8 +79,8 @@ func hubKubeadmControlPlaneStatus(in *controlplanev1.KubeadmControlPlaneStatus,
}
}

func spokeKubeadmControlPlaneStatus(in *KubeadmControlPlaneStatus, c fuzz.Continue) {
c.FuzzNoCustom(in)
func spokeKubeadmControlPlaneStatus(in *KubeadmControlPlaneStatus, c randfill.Continue) {
c.FillNoCustom(in)
// Drop empty structs with only omit empty fields.
if in.V1Beta2 != nil {
if reflect.DeepEqual(in.V1Beta2, &KubeadmControlPlaneV1Beta2Status{}) {
Expand All @@ -98,8 +98,8 @@ func KubeadmControlPlaneTemplateFuzzFuncs(_ runtimeserializer.CodecFactory) []in
}
}

func spokeKubeadmConfigSpec(in *bootstrapv1beta1.KubeadmConfigSpec, c fuzz.Continue) {
c.FuzzNoCustom(in)
func spokeKubeadmConfigSpec(in *bootstrapv1beta1.KubeadmConfigSpec, c randfill.Continue) {
c.FillNoCustom(in)

// Drop UseExperimentalRetryJoin as we intentionally don't preserve it.
in.UseExperimentalRetryJoin = false
Expand Down
Loading
Loading