fix lint loop iterator problem

Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
This commit is contained in:
Lyndon-Li
2022-10-18 22:40:48 +08:00
parent d7b4583b2b
commit c92f06ef17
18 changed files with 57 additions and 62 deletions
+3 -3
View File
@@ -61,12 +61,12 @@ func IsRunningInNode(ctx context.Context, namespace string, nodeName string, pod
return errors.Wrap(err, "failed to list daemonset pods")
}
for _, pod := range pods.Items {
if kube.IsPodRunning(&pod) != nil { //nolint
for i := range pods.Items {
if kube.IsPodRunning(&pods.Items[i]) != nil {
continue
}
if pod.Spec.NodeName == nodeName {
if pods.Items[i].Spec.NodeName == nodeName {
return nil
}
}