mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-07-29 11:32:42 +00:00
fix node-agent node detection logic
Add namespace in ListOptions, to fix node-agent node detection in its deployed namespace. Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
This commit is contained in:
@@ -97,7 +97,10 @@ func isRunningInNode(ctx context.Context, namespace string, nodeName string, crC
|
||||
}
|
||||
|
||||
if crClient != nil {
|
||||
err = crClient.List(ctx, pods, &ctrlclient.ListOptions{LabelSelector: parsedSelector})
|
||||
err = crClient.List(ctx, pods, &ctrlclient.ListOptions{
|
||||
LabelSelector: parsedSelector,
|
||||
Namespace: namespace,
|
||||
})
|
||||
} else {
|
||||
pods, err = kubeClient.CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{LabelSelector: parsedSelector.String()})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user