Skip to content

Commit 95b628c

Browse files
authored
🌱 Fix CI (PR verify) and avoid returning err+RequeueAfter. (#1591)
1 parent 2df021a commit 95b628c

13 files changed

+25
-20
lines changed

.github/workflows/pr-verify.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ jobs:
2525
exit 1
2626
fi
2727
28-
if ! [[ "$TITLE" =~ ^($'\u26A0'|$'\u2728'|$'\U0001F41B'|$'\U0001F4D6'|$'\U0001F680'|$'\U0001F331') ]]; then
28+
if ! [[ "$TITLE" =~ ^($'\u26A0'|:warning:|$'\u2728'|:sparkles:|$'\U0001F41B'|:bug:|$'\U0001F4D6'|:book:|$'\U0001F680'|:release:|$'\U0001F331'|:seedling:) ]]; then
2929
echo "Error: Invalid PR title format."
3030
echo "Your PR title must start with one of the following indicators:"
31-
echo "- Breaking change: ⚠ (U+26A0)"
32-
echo "- Non-breaking feature: ✨ (U+2728)"
33-
echo "- Patch fix: 🐛 (U+1F41B)"
34-
echo "- Docs: 📖 (U+1F4D6)"
35-
echo "- Release: 🚀 (U+1F680)"
36-
echo "- Infra/Tests/Other: 🌱 (U+1F331)"
31+
echo "- Breaking change: ⚠ (U+26A0) or :warning:"
32+
echo "- Non-breaking feature: ✨ (U+2728) or :sparkles:"
33+
echo "- Patch fix: 🐛 (U+1F41B) or :bug:"
34+
echo "- Docs: 📖 (U+1F4D6) or :book:"
35+
echo "- Release: 🚀 (U+1F680) or :release:"
36+
echo "- Infra/Tests/Other: 🌱 (U+1F331) or :seedling:"
3737
exit 1
3838
fi
3939

controllers/hcloudmachine_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ type HCloudMachineReconciler struct {
6767
//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=hcloudmachines/finalizers,verbs=update
6868

6969
// Reconcile manages the lifecycle of an HCloud machine object.
70-
func (r *HCloudMachineReconciler) Reconcile(ctx context.Context, req reconcile.Request) (_ reconcile.Result, reterr error) {
70+
func (r *HCloudMachineReconciler) Reconcile(ctx context.Context, req reconcile.Request) (res reconcile.Result, reterr error) {
7171
log := ctrl.LoggerFrom(ctx)
7272

7373
// Fetch the HCloudMachine instance.
@@ -154,6 +154,7 @@ func (r *HCloudMachineReconciler) Reconcile(ctx context.Context, req reconcile.R
154154
}
155155

156156
if err := machineScope.Close(ctx); err != nil && reterr == nil {
157+
res = reconcile.Result{}
157158
reterr = err
158159
}
159160
}()

controllers/hcloudmachine_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ var _ = Describe("HCloudMachineReconciler", func() {
318318
Expect(testEnv.Cleanup(ctx, testNs, capiCluster, hetznerSecret, bootstrapSecret)).To(Succeed())
319319
})
320320

321-
Context("Basic test", func() {
321+
Context("Basic hcloudmachine test", func() {
322322
Context("correct server", func() {
323323
BeforeEach(func() {
324324
// remove bootstrap infos

controllers/hcloudmachinetemplate_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var _ = Describe("HCloudMachineTemplateReconciler", func() {
5353
Expect(testEnv.Cleanup(ctx, testNs, hetznerSecret)).To(Succeed())
5454
})
5555

56-
Context("Basic test", func() {
56+
Context("Basic hcloudmachinetemplate test", func() {
5757
Context("ClusterClass test", func() {
5858
var capiClusterClass *clusterv1.ClusterClass
5959

controllers/hcloudremediation_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ type HCloudRemediationReconciler struct {
5757
//+kubebuilder:rbac:groups=cluster.x-k8s.io,resources=machines;machines/status,verbs=get;update;patch
5858

5959
// Reconcile reconciles the hetznerHCloudRemediation object.
60-
func (r *HCloudRemediationReconciler) Reconcile(ctx context.Context, req reconcile.Request) (_ reconcile.Result, reterr error) {
60+
func (r *HCloudRemediationReconciler) Reconcile(ctx context.Context, req reconcile.Request) (res reconcile.Result, reterr error) {
6161
log := ctrl.LoggerFrom(ctx)
6262

6363
hcloudRemediation := &infrav1.HCloudRemediation{}
@@ -165,6 +165,7 @@ func (r *HCloudRemediationReconciler) Reconcile(ctx context.Context, req reconci
165165
patchOpts = append(patchOpts, patch.WithStatusObservedGeneration{})
166166

167167
if err := remediationScope.Close(ctx, patchOpts...); err != nil && reterr == nil {
168+
res = reconcile.Result{}
168169
reterr = err
169170
}
170171
}()

controllers/hcloudremediation_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ var _ = Describe("HCloudRemediationReconciler", func() {
186186
hetznerSecret, bootstrapSecret, hetznerCluster, capiMachine, capiCluster)).To(Succeed())
187187
})
188188

189-
Context("Basic test", func() {
189+
Context("Basic hcloudremediation test", func() {
190190
It("creates the hcloudRemediation successfully", func() {
191191
Expect(testEnv.Create(ctx, hcloudRemediation)).To(Succeed())
192192

controllers/hetznerbaremetalhost_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ var _ = Describe("HetznerBareMetalHostReconciler", func() {
192192
hetznerSecret, rescueSSHSecret, osSSHSecret, bootstrapSecret)).To(Succeed())
193193
})
194194

195-
Context("Basic test", func() {
195+
Context("Basic hbmh test", func() {
196196
BeforeEach(func() {
197197
host = helpers.BareMetalHost(
198198
hostName,

controllers/hetznerbaremetalmachine_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ type HetznerBareMetalMachineReconciler struct {
6060
//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=hetznerbaremetalmachines/finalizers,verbs=update
6161

6262
// Reconcile implements the reconcilement of HetznerBareMetalMachine objects.
63-
func (r *HetznerBareMetalMachineReconciler) Reconcile(ctx context.Context, req reconcile.Request) (_ reconcile.Result, reterr error) {
63+
func (r *HetznerBareMetalMachineReconciler) Reconcile(ctx context.Context, req reconcile.Request) (res reconcile.Result, reterr error) {
6464
log := ctrl.LoggerFrom(ctx)
6565

6666
// Fetch the Hetzner bare metal instance.
@@ -145,6 +145,7 @@ func (r *HetznerBareMetalMachineReconciler) Reconcile(ctx context.Context, req r
145145
conditions.SetSummary(hbmMachine)
146146

147147
if err := machineScope.Close(ctx); err != nil && reterr == nil {
148+
res = reconcile.Result{}
148149
reterr = err
149150
}
150151
}()

controllers/hetznerbaremetalmachine_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ var _ = Describe("HetznerBareMetalMachineReconciler", func() {
266266
})
267267
})
268268

269-
Context("Basic test", func() {
269+
Context("Basic hbmm test", func() {
270270
var osSSHSecret *corev1.Secret
271271

272272
BeforeEach(func() {

controllers/hetznerbaremetalremediation_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ type HetznerBareMetalRemediationReconciler struct {
4848
//+kubebuilder:rbac:groups=cluster.x-k8s.io,resources=machines;machines/status,verbs=get;update;patch
4949

5050
// Reconcile reconciles the hetznerBareMetalRemediation object.
51-
func (r *HetznerBareMetalRemediationReconciler) Reconcile(ctx context.Context, req reconcile.Request) (_ reconcile.Result, reterr error) {
51+
func (r *HetznerBareMetalRemediationReconciler) Reconcile(ctx context.Context, req reconcile.Request) (res reconcile.Result, reterr error) {
5252
log := ctrl.LoggerFrom(ctx)
5353

5454
// Fetch the Hetzner bare metal host instance.
@@ -140,6 +140,7 @@ func (r *HetznerBareMetalRemediationReconciler) Reconcile(ctx context.Context, r
140140
patchOpts = append(patchOpts, patch.WithStatusObservedGeneration{})
141141

142142
if err := remediationScope.Close(ctx, patchOpts...); err != nil && reterr == nil {
143+
res = reconcile.Result{}
143144
reterr = err
144145
}
145146
}()

controllers/hetznerbaremetalremediation_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ var _ = Describe("HetznerBareMetalRemediationReconciler", func() {
232232
Expect(testEnv.Cleanup(ctx, testNs, capiCluster, capiMachine, hetznerCluster)).To(Succeed())
233233
})
234234

235-
Context("Basic test", func() {
235+
Context("Basic hetznerbaremetalremediation test", func() {
236236
Context("HetznerBareMetalHost will get provisioned", func() {
237237
BeforeEach(func() {
238238
hetznerSecret = getDefaultHetznerSecret(testNs.Name)

controllers/hetznercluster_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ type HetznerClusterReconciler struct {
8686
//+kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=hetznerclusters/finalizers,verbs=update
8787

8888
// Reconcile manages the lifecycle of a HetznerCluster object.
89-
func (r *HetznerClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error) {
89+
func (r *HetznerClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res ctrl.Result, reterr error) {
9090
log := ctrl.LoggerFrom(ctx)
9191

9292
// Fetch the HetznerCluster instance
@@ -152,6 +152,7 @@ func (r *HetznerClusterReconciler) Reconcile(ctx context.Context, req ctrl.Reque
152152
}
153153

154154
if err := clusterScope.Close(ctx); err != nil && reterr == nil {
155+
res = reconcile.Result{}
155156
reterr = err
156157
}
157158
}()

controllers/hetznercluster_controller_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,15 +625,15 @@ var _ = Describe("Hetzner ClusterReconciler", func() {
625625
return false
626626
}, timeout, time.Second).Should(BeTrue())
627627

628-
By("deleting the cluster and load balancer and testing that owned label is gone")
628+
By("deleting the cluster and load balancer and testing that owned label is gone (flaky)")
629629

630630
Expect(testEnv.Delete(ctx, instance))
631631

632632
Eventually(func() bool {
633633
loadBalancers, err := hcloudClient.ListLoadBalancers(ctx, hcloud.LoadBalancerListOpts{Name: lbName})
634634
// there should always be one load balancer, if not, then this is a problem where we can immediately return
635635
Expect(err).To(BeNil())
636-
Expect(loadBalancers).To(HaveLen(1))
636+
Expect(loadBalancers).To(HaveLen(1)) // flaky
637637

638638
_, found := loadBalancers[0].Labels[instance.ClusterTagKey()]
639639
return found

0 commit comments

Comments
 (0)