From 444d64f70196a5069e9509c280be936170aefd9a Mon Sep 17 00:00:00 2001 From: makhov Date: Mon, 6 Nov 2023 12:57:05 +0200 Subject: [PATCH] DockerMachine panic fix --- .../docker/internal/controllers/dockermachine_controller.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/infrastructure/docker/internal/controllers/dockermachine_controller.go b/test/infrastructure/docker/internal/controllers/dockermachine_controller.go index c54fffda7b83..f24c0bd5b6ba 100644 --- a/test/infrastructure/docker/internal/controllers/dockermachine_controller.go +++ b/test/infrastructure/docker/internal/controllers/dockermachine_controller.go @@ -119,6 +119,11 @@ func (r *DockerMachineReconciler) Reconcile(ctx context.Context, req ctrl.Reques return ctrl.Result{}, nil } + if cluster.Spec.InfrastructureRef == nil { + log.Info("Cluster infrastructureRef is not available yet") + return ctrl.Result{}, nil + } + // Fetch the Docker Cluster. dockerCluster := &infrav1.DockerCluster{} dockerClusterName := client.ObjectKey{