Skip to content
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
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ linters:
- linters:
- staticcheck
text: 'SA1019: .*(res|result|i|j)\.Requeue is deprecated: Use `RequeueAfter` instead'
# TODO: Remove Requeue step by step
path: internal/controllers/(extensionconfig|machinepool)|util/util.go
Copy link
Member

@sbueringer sbueringer Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change util/util.go to a local nolint in LowestNonZeroResult in the next PR (it's fine to combine it with a change to another controller)

We have to keep handling Requeue there until the field is removed by controller-runtime

(and I don't want to keep the exclude here so long because I'm not sure how long it will take to drop the field in CR)

# TODO: var-naming: avoid meaningless package names by revive
# * test/infrastructure/docker/internal/docker/types/
# * bootstrap/kubeadm/types/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package controllers

import (
"testing"
"time"

. "github.com/onsi/gomega"
ctrl "sigs.k8s.io/controller-runtime"
Expand Down Expand Up @@ -61,7 +62,7 @@ func TestKubeadmConfigReconciler(t *testing.T) {
},
})
g.Expect(err).To(Succeed())
g.Expect(result.Requeue).To(BeFalse())
g.Expect(result.RequeueAfter).To(Equal(time.Duration(0)))
})
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ func TestKubeadmConfigReconciler_Reconcile_ReturnEarlyIfKubeadmConfigIsReady(t *
}
result, err := k.Reconcile(ctx, request)
g.Expect(err).ToNot(HaveOccurred())
g.Expect(result.Requeue).To(BeFalse())
g.Expect(result.RequeueAfter).To(Equal(time.Duration(0)))
}

Expand Down Expand Up @@ -297,7 +296,6 @@ func TestKubeadmConfigReconciler_Reconcile_ReturnEarlyIfMachineHasDataSecretName
actual := &bootstrapv1.KubeadmConfig{}
g.Expect(myclient.Get(ctx, client.ObjectKey{Namespace: config.Namespace, Name: config.Name}, actual)).To(Succeed())
g.Expect(err).ToNot(HaveOccurred())
g.Expect(result.Requeue).To(BeFalse())
g.Expect(result.RequeueAfter).To(Equal(time.Duration(0)))
assertHasTrueCondition(g, myclient, request, bootstrapv1.KubeadmConfigDataSecretAvailableCondition)
}
Expand Down Expand Up @@ -476,7 +474,6 @@ func TestKubeadmConfigReconciler_Reconcile_RequeueJoiningNodesIfControlPlaneNotI

result, err := k.Reconcile(ctx, tc.request)
g.Expect(err).ToNot(HaveOccurred())
g.Expect(result.Requeue).To(BeFalse())
g.Expect(result.RequeueAfter).To(Equal(30 * time.Second))
assertHasFalseCondition(g, myclient, tc.request, bootstrapv1.KubeadmConfigDataSecretAvailableCondition, bootstrapv1.KubeadmConfigDataSecretNotAvailableReason)
})
Expand Down Expand Up @@ -528,7 +525,6 @@ func TestKubeadmConfigReconciler_Reconcile_GenerateCloudConfigData(t *testing.T)

result, err := k.Reconcile(ctx, request)
g.Expect(err).ToNot(HaveOccurred())
g.Expect(result.Requeue).To(BeFalse())
g.Expect(result.RequeueAfter).To(Equal(time.Duration(0)))

cfg, err := getKubeadmConfig(myclient, "control-plane-init-cfg", metav1.NamespaceDefault)
Expand Down Expand Up @@ -631,7 +627,6 @@ func TestKubeadmConfigReconciler_Reconcile_RequeueIfControlPlaneIsMissingAPIEndp
}
result, err := k.Reconcile(ctx, request)
g.Expect(err).ToNot(HaveOccurred())
g.Expect(result.Requeue).To(BeFalse())
g.Expect(result.RequeueAfter).To(Equal(10 * time.Second))

actualConfig := &bootstrapv1.KubeadmConfig{}
Expand Down Expand Up @@ -709,7 +704,6 @@ func TestReconcileIfJoinCertificatesAvailableConditioninNodesAndControlPlaneIsRe
}
result, err := k.Reconcile(ctx, request)
g.Expect(err).ToNot(HaveOccurred())
g.Expect(result.Requeue).To(BeFalse())
g.Expect(result.RequeueAfter).To(Equal(time.Duration(0)))

cfg, err := getKubeadmConfig(myclient, rt.configName, metav1.NamespaceDefault)
Expand Down Expand Up @@ -786,7 +780,6 @@ func TestReconcileIfJoinNodePoolsAndControlPlaneIsReady(t *testing.T) {
}
result, err := k.Reconcile(ctx, request)
g.Expect(err).ToNot(HaveOccurred())
g.Expect(result.Requeue).To(BeFalse())
g.Expect(result.RequeueAfter).To(Equal(time.Duration(0)))

cfg, err := getKubeadmConfig(myclient, rt.configName, metav1.NamespaceDefault)
Expand Down Expand Up @@ -993,7 +986,6 @@ func TestKubeadmConfigSecretCreatedStatusNotPatched(t *testing.T) {
g.Expect(err).ToNot(HaveOccurred())
result, err := k.Reconcile(ctx, request)
g.Expect(err).ToNot(HaveOccurred())
g.Expect(result.Requeue).To(BeFalse())
g.Expect(result.RequeueAfter).To(Equal(time.Duration(0)))

cfg, err := getKubeadmConfig(myclient, "worker-join-cfg", metav1.NamespaceDefault)
Expand Down Expand Up @@ -1236,7 +1228,6 @@ func TestBootstrapTokenTTLExtension(t *testing.T) {
} {
result, err := k.Reconcile(ctx, req)
g.Expect(err).ToNot(HaveOccurred())
g.Expect(result.Requeue).To(BeFalse())
g.Expect(result.RequeueAfter).To(Equal(time.Duration(0)))
}

Expand Down Expand Up @@ -2085,7 +2076,6 @@ func TestKubeadmConfigReconciler_Reconcile_ExactlyOneControlPlaneMachineInitiali
}
result, err := k.Reconcile(ctx, request)
g.Expect(err).ToNot(HaveOccurred())
g.Expect(result.Requeue).To(BeFalse())
g.Expect(result.RequeueAfter).To(Equal(time.Duration(0)))

request = ctrl.Request{
Expand All @@ -2096,7 +2086,6 @@ func TestKubeadmConfigReconciler_Reconcile_ExactlyOneControlPlaneMachineInitiali
}
result, err = k.Reconcile(ctx, request)
g.Expect(err).ToNot(HaveOccurred())
g.Expect(result.Requeue).To(BeFalse())
g.Expect(result.RequeueAfter).To(Equal(30 * time.Second))
confList := &bootstrapv1.KubeadmConfigList{}
g.Expect(myclient.List(ctx, confList)).To(Succeed())
Expand Down Expand Up @@ -2151,7 +2140,6 @@ func TestKubeadmConfigReconciler_Reconcile_PatchWhenErrorOccurred(t *testing.T)

result, err := k.Reconcile(ctx, request)
g.Expect(err).To(HaveOccurred())
g.Expect(result.Requeue).To(BeFalse())
g.Expect(result.RequeueAfter).To(Equal(time.Duration(0)))

cfg, err := getKubeadmConfig(myclient, "control-plane-init-cfg", metav1.NamespaceDefault)
Expand Down