From d5bb2ba66d660ff1ed1f45dff0cbce37219817dd Mon Sep 17 00:00:00 2001 From: Chin-Ya Huang Date: Mon, 17 Apr 2023 13:15:41 +0800 Subject: [PATCH] fix(agent): completed without expected nodes Signed-off-by: Chin-Ya Huang --- pkg/manager/manager.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/manager/manager.go b/pkg/manager/manager.go index f857fbff1..39d0315a9 100644 --- a/pkg/manager/manager.go +++ b/pkg/manager/manager.go @@ -392,6 +392,9 @@ func (m *SupportBundleManager) getAgentNodesIn(podList *v1.PodList) ([]*v1.Node, } func (m *SupportBundleManager) refreshNodes(agentDaemonSet *appsv1.DaemonSet) error { + m.nodesLock.Lock() + defer m.nodesLock.Unlock() + podList, err := m.getAgentPodsCreatedBy(agentDaemonSet) if err != nil { return err