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:
parent
47205db5b2
commit
45170df566
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user