From 450990fa0435be6667c47ffe20a0d55e1625ed19 Mon Sep 17 00:00:00 2001 From: baoyinghai_yewu Date: Wed, 29 May 2024 10:39:47 +0800 Subject: [PATCH] fix: ignore errors of vc kubeconfig empty Signed-off-by: baoyinghai_yewu --- .../virtualcluster.node.controller/node_controller.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/kubenest/controller/virtualcluster.node.controller/node_controller.go b/pkg/kubenest/controller/virtualcluster.node.controller/node_controller.go index 38f39b58b..4264746ae 100644 --- a/pkg/kubenest/controller/virtualcluster.node.controller/node_controller.go +++ b/pkg/kubenest/controller/virtualcluster.node.controller/node_controller.go @@ -244,6 +244,11 @@ func (r *NodeController) Reconcile(ctx context.Context, request reconcile.Reques return reconcile.Result{}, nil } + if len(virtualCluster.Spec.Kubeconfig) == 0 { + klog.Warning("virtualcluster.spec.kubeconfig is nil, wait virtualcluster control-plane ready.") + return reconcile.Result{}, nil + } + if err := r.DoNodeTask(ctx, virtualCluster); err != nil { klog.Errorf("virtualcluster %s do node task failed: %v", virtualCluster.Name, err) if err := r.UpdateVirtualClusterStatus(ctx, virtualCluster, v1alpha1.Pending, err.Error()); err != nil {