From 2243226bd4031239c4d5f89afa6336e7bfd3c9fd Mon Sep 17 00:00:00 2001 From: Boris Djurdjevic Date: Tue, 20 Apr 2021 14:17:58 +0200 Subject: [PATCH] fix(discovery): Prevent panic when checking for schedulable nodes only --- pkg/kubediscovery/kubediscovery.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/kubediscovery/kubediscovery.go b/pkg/kubediscovery/kubediscovery.go index 3544e7a7..6b73c834 100644 --- a/pkg/kubediscovery/kubediscovery.go +++ b/pkg/kubediscovery/kubediscovery.go @@ -56,8 +56,8 @@ func New(ctx context.Context, allowUnschedulable bool) (*Client, error) { var nc *nodeCache - // Watch nodes only if we consider kubenurses on unschedulable nodes - if allowUnschedulable { + // Watch nodes only if we do not consider kubenurses on unschedulable nodes + if !allowUnschedulable { nc, err = watchNodes(ctx, cliset) if err != nil { return nil, fmt.Errorf("starting node watcher: %w", err)