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)

This commit is contained in:
Hermes Agent 2026-08-07 08:12:42 +00:00
parent 47205db5b2
commit 45170df566

View File

@ -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 {