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{