From 74a5d4b667f61939ce7d128d71c35d3dd4d39098 Mon Sep 17 00:00:00 2001 From: PrimalPimmy Date: Thu, 20 Jun 2024 23:51:12 +0530 Subject: [PATCH] Cluster checking-2 Signed-off-by: PrimalPimmy --- controllers/pkg/reconcilers/spire-bootstrap/reconciler.go | 6 +++--- operators/nephio-controller-manager/main.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/controllers/pkg/reconcilers/spire-bootstrap/reconciler.go b/controllers/pkg/reconcilers/spire-bootstrap/reconciler.go index a5295651..7f18688d 100644 --- a/controllers/pkg/reconcilers/spire-bootstrap/reconciler.go +++ b/controllers/pkg/reconcilers/spire-bootstrap/reconciler.go @@ -22,8 +22,8 @@ import ( reconcilerinterface "github.com/nephio-project/nephio/controllers/pkg/reconcilers/reconciler-interface" "k8s.io/apimachinery/pkg/runtime/schema" - corev1 "k8s.io/api/core/v1" "sigs.k8s.io/cluster-api/api/v1beta1" + capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/event" @@ -44,7 +44,7 @@ func (r *reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, c a return nil, ctrl.NewControllerManagedBy(mgr). Named("BootstrapSpireController"). - For(&corev1.ConfigMap{}). + For(&capiv1beta1.Cluster{}). Complete(r) } @@ -58,7 +58,7 @@ func (r *reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu log := log.FromContext(ctx) // Fetch the Cluster instance - cluster := &v1beta1.Cluster{} + cluster := &v1beta1.ClusterClass{} err := r.Get(ctx, req.NamespacedName, cluster) if err != nil { if client.IgnoreNotFound(err) != nil { diff --git a/operators/nephio-controller-manager/main.go b/operators/nephio-controller-manager/main.go index 7a3c7bd4..9d77d130 100644 --- a/operators/nephio-controller-manager/main.go +++ b/operators/nephio-controller-manager/main.go @@ -41,9 +41,9 @@ import ( "k8s.io/client-go/tools/leaderelection/resourcelock" "k8s.io/klog/v2/klogr" - "k8s.io/apimachinery/pkg/apis/meta/v1beta1" "k8s.io/apimachinery/pkg/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" + capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" //+kubebuilder:scaffold:imports @@ -110,7 +110,7 @@ func main() { os.Exit(1) } - err = v1beta1.AddMetaToScheme(scheme) + err = capiv1beta1.AddToScheme(scheme) if err != nil { setupLog.Error(err, "cannot initializer schema with Cluster API(s)") // klog.Errorf("error initializing scheme with Porch APIs: %s", err.Error())