From b452ab6a5caf1e7d18a709098dfd15e5667de29b Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Mon, 22 Jan 2024 14:07:46 +0200 Subject: [PATCH] topology-updater: initialize properly with -no-publish We need to parse kubeconfig (and initialize the apihelper) even with -no-publish as the PodResourcesScanner accesses the k8s API even if we're not publishing/updating NRTs. --- pkg/nfd-topology-updater/nfd-topology-updater.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkg/nfd-topology-updater/nfd-topology-updater.go b/pkg/nfd-topology-updater/nfd-topology-updater.go index 4884dc4c6a..8ebd71fd50 100644 --- a/pkg/nfd-topology-updater/nfd-topology-updater.go +++ b/pkg/nfd-topology-updater/nfd-topology-updater.go @@ -131,13 +131,12 @@ func (w *nfdTopologyUpdater) Run() error { return fmt.Errorf("failed to get PodResource Client: %w", err) } - if !w.args.NoPublish { - kubeconfig, err := apihelper.GetKubeconfig(w.args.KubeConfigFile) - if err != nil { - return err - } - w.apihelper = apihelper.K8sHelpers{Kubeconfig: kubeconfig} + kubeconfig, err := apihelper.GetKubeconfig(w.args.KubeConfigFile) + if err != nil { + return err } + w.apihelper = apihelper.K8sHelpers{Kubeconfig: kubeconfig} + if err := w.configure(); err != nil { return fmt.Errorf("faild to configure Node Feature Discovery Topology Updater: %w", err) }