From 32db081f3a9e2781b4f885416b70f69a8ba76634 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Wed, 19 Apr 2023 15:58:06 +0300 Subject: [PATCH] nfd-master: support noPublish with -prune Better this way than to crash which is what currently happens with this combination. --- pkg/nfd-master/nfd-master.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/nfd-master/nfd-master.go b/pkg/nfd-master/nfd-master.go index 811ad576d9..21776549b5 100644 --- a/pkg/nfd-master/nfd-master.go +++ b/pkg/nfd-master/nfd-master.go @@ -384,6 +384,11 @@ func (m *nfdMaster) WaitForReady(timeout time.Duration) bool { // Prune erases all NFD related properties from the node objects of the cluster. func (m *nfdMaster) prune() error { + if m.config.NoPublish { + klog.Info("skipping pruning of nodes as noPublish config option is set") + return nil + } + cli, err := m.apihelper.GetClient() if err != nil { return err