From 57bfeef9fe2e41576761fbe95e2995c6c6df3ec6 Mon Sep 17 00:00:00 2001 From: Danil-Grigorev Date: Fri, 25 Oct 2024 12:20:52 +0200 Subject: [PATCH] Fix panic in webhook for CC clusters Signed-off-by: Danil-Grigorev --- exp/etcdrestore/controllers/etcdsnapshotsync_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exp/etcdrestore/controllers/etcdsnapshotsync_controller.go b/exp/etcdrestore/controllers/etcdsnapshotsync_controller.go index e604518d..62d61903 100644 --- a/exp/etcdrestore/controllers/etcdsnapshotsync_controller.go +++ b/exp/etcdrestore/controllers/etcdsnapshotsync_controller.go @@ -87,7 +87,7 @@ func (r *EtcdSnapshotSyncReconciler) Reconcile(ctx context.Context, req ctrl.Req } // Only reconcile RKE2 clusters - if cluster.Spec.ControlPlaneRef.Kind != RKE2ControlPlaneKind { // TODO: Move to predicate + if cluster.Spec.ControlPlaneRef == nil || cluster.Spec.ControlPlaneRef.Kind != RKE2ControlPlaneKind { // TODO: Move to predicate log.Info("Cluster is not an RKE2 cluster, skipping reconciliation") return ctrl.Result{RequeueAfter: 3 * time.Minute}, nil }