From 2f8642f92e298225e7a9474065da3860f59b1489 Mon Sep 17 00:00:00 2001 From: Alice Frosi Date: Tue, 25 Aug 2026 15:10:46 +0200 Subject: [PATCH] Fix golines for the ci unit Run `make go-lines-fix` and fix the formatting. Signed-off-by: Alice Frosi --- internal/controller/bootcnodepool_controller.go | 11 +++++++++-- internal/controller/membership_test.go | 17 +++++++++++++---- internal/daemon/reconciler.go | 3 ++- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/internal/controller/bootcnodepool_controller.go b/internal/controller/bootcnodepool_controller.go index 4caef48..4fe6216 100644 --- a/internal/controller/bootcnodepool_controller.go +++ b/internal/controller/bootcnodepool_controller.go @@ -329,7 +329,10 @@ func (r *BootcNodePoolReconciler) Reconcile( // It removes the bootc.dev/managed label from all member nodes and deletes // the owned BootcNode objects, then removes the cleanup finalizer so // Kubernetes can complete the deletion. -func (r *BootcNodePoolReconciler) handlePoolDeletion(ctx context.Context, pool *bootcv1alpha1.BootcNodePool) (ctrl.Result, error) { +func (r *BootcNodePoolReconciler) handlePoolDeletion( + ctx context.Context, + pool *bootcv1alpha1.BootcNodePool, +) (ctrl.Result, error) { log := logf.FromContext(ctx).WithValues("pool", pool.Name) if !controllerutil.ContainsFinalizer(pool, bootcv1alpha1.FinalizerPoolCleanup) { @@ -351,7 +354,11 @@ func (r *BootcNodePoolReconciler) handlePoolDeletion(ctx context.Context, pool * } log.Info("Removing BootcNode for pool deletion", "node", bn.Name) if err := r.removeBootcNode(ctx, bn); err != nil { - return ctrl.Result{}, fmt.Errorf("removing BootcNode %s during pool deletion: %w", bn.Name, err) + return ctrl.Result{}, fmt.Errorf( + "removing BootcNode %s during pool deletion: %w", + bn.Name, + err, + ) } } diff --git a/internal/controller/membership_test.go b/internal/controller/membership_test.go index c4ba9ab..1ec3828 100644 --- a/internal/controller/membership_test.go +++ b/internal/controller/membership_test.go @@ -242,7 +242,11 @@ func TestPoolDeletionRemovesManagedLabel(t *testing.T) { } // Create a worker pool and a separate control-plane pool. - workerPool := testutil.NewPool("del-workers", testImageDigestRefA, testutil.WithWorkerSelector()) + workerPool := testutil.NewPool( + "del-workers", + testImageDigestRefA, + testutil.WithWorkerSelector(), + ) g.Expect(k8sClient.Create(ctx, workerPool)).To(Succeed()) cpPool := testutil.NewPool("del-control-plane", testImageDigestRefA, @@ -286,7 +290,11 @@ func TestPoolDeletionRemovesManagedLabel(t *testing.T) { // The worker pool itself should be fully deleted (finalizer removed). g.Eventually(func() error { - return k8sClient.Get(ctx, client.ObjectKeyFromObject(workerPool), &bootcv1alpha1.BootcNodePool{}) + return k8sClient.Get( + ctx, + client.ObjectKeyFromObject(workerPool), + &bootcv1alpha1.BootcNodePool{}, + ) }).Should(MatchError(apierrors.IsNotFound, "IsNotFound"), "worker pool should be fully deleted") // Control-plane nodes must still carry the managed label — their pool was not deleted. @@ -299,8 +307,9 @@ func TestPoolDeletionRemovesManagedLabel(t *testing.T) { // Control-plane BootcNodes must still exist. for _, node := range controlPlaneNodes { - g.Expect(k8sClient.Get(ctx, client.ObjectKey{Name: node.Name}, &bootcv1alpha1.BootcNode{})).To(Succeed(), - "BootcNode %s should still exist", node.Name) + g.Expect(k8sClient.Get(ctx, client.ObjectKey{Name: node.Name}, &bootcv1alpha1.BootcNode{})). + To(Succeed(), + "BootcNode %s should still exist", node.Name) } } diff --git a/internal/daemon/reconciler.go b/internal/daemon/reconciler.go index 2f77c99..901445a 100644 --- a/internal/daemon/reconciler.go +++ b/internal/daemon/reconciler.go @@ -5,11 +5,12 @@ package daemon import ( "context" "fmt" - "github.com/distribution/reference" "reflect" "sync" "time" + "github.com/distribution/reference" + "github.com/go-logr/logr" apierrors "k8s.io/apimachinery/pkg/api/errors" apimeta "k8s.io/apimachinery/pkg/api/meta"