From 45170df566c2aa387f8b706c3a704abce5aa2557 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Fri, 7 Aug 2026 08:12:42 +0000 Subject: [PATCH] fix(hermes): Both guards only skip the current pod. Merging them into one equivalent OR condition retains evaluation order and skip behavior while eliminating one conditional branch. (incident sonar/soteria/go:S3776/AZ9pTqWRN0JrBQvDGDs4) --- internal/k8s/jobs.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/k8s/jobs.go b/internal/k8s/jobs.go index f68c832..5e42bfd 100644 --- a/internal/k8s/jobs.go +++ b/internal/k8s/jobs.go @@ -221,10 +221,8 @@ func (c *Client) resolvePVCMountedNode(ctx context.Context, namespace, pvc strin } for _, pod := range pods.Items { - if pod.DeletionTimestamp != nil || pod.Spec.NodeName == "" { - continue - } - if pod.Status.Phase == corev1.PodSucceeded || pod.Status.Phase == corev1.PodFailed { + if pod.DeletionTimestamp != nil || pod.Spec.NodeName == "" || + pod.Status.Phase == corev1.PodSucceeded || pod.Status.Phase == corev1.PodFailed { continue } for _, volume := range pod.Spec.Volumes {