From 423842c551a7f93fd586bf7ee7d16ad427c06ba4 Mon Sep 17 00:00:00 2001 From: Hunter Gregory <42728408+huntergregory@users.noreply.github.com> Date: Mon, 6 Jan 2025 18:23:20 -0800 Subject: [PATCH] resolved merge conflict as there isnt npm lite in v1.5 --- npm/cmd/start.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/npm/cmd/start.go b/npm/cmd/start.go index a9425c9458..b36d10422d 100644 --- a/npm/cmd/start.go +++ b/npm/cmd/start.go @@ -120,7 +120,10 @@ func start(config npmconfig.Config, flags npmconfig.Flags) error { klog.Infof("Resync period for NPM pod is set to %d.", int(resyncPeriod/time.Minute)) factory := informers.NewSharedInformerFactory(clientset, resyncPeriod) - k8sServerVersion := k8sServerVersion(clientset) + err = metrics.CreateTelemetryHandle(config.NPMVersion(), version, npm.GetAIMetadata()) + if err != nil { + klog.Infof("CreateTelemetryHandle failed with error %v. AITelemetry is not initialized.", err) + } var dp dataplane.GenericDataplane stopChannel := wait.NeverStop @@ -184,11 +187,9 @@ func start(config npmconfig.Config, flags npmconfig.Flags) error { } dp.RunPeriodicTasks() } + + k8sServerVersion := k8sServerVersion(clientset) npMgr := npm.NewNetworkPolicyManager(config, factory, dp, exec.New(), version, k8sServerVersion) - err = metrics.CreateTelemetryHandle(config.NPMVersion(), version, npm.GetAIMetadata()) - if err != nil { - klog.Infof("CreateTelemetryHandle failed with error %v. AITelemetry is not initialized.", err) - } go restserver.NPMRestServerListenAndServe(config, npMgr)