Skip to content

Commit 62c7081

Browse files
skip replicasets with zero replicas
1 parent df75a30 commit 62c7081

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/integration/test_networking.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ async def test_services_have_matching_labels(
4646
# For Pods part of a replicaset we must ignore pods which template-hash do not match
4747
# the latest replicaset `pod-template-hash`
4848
if pod.metadata and pod.metadata.labels and pod.metadata.labels.get("pod-template-hash"):
49-
async for _ in kube_client.list(
49+
async for rs in kube_client.list(
5050
ReplicaSet,
5151
namespace=generated_data.ess_namespace,
5252
labels={"pod-template-hash": op.equal(pod.metadata.labels["pod-template-hash"])},
5353
):
54-
# if any rs matches the pod's template hash,
55-
# the pod is one of the current replicaset and must be checked
56-
break
54+
# we check if the rs desires replicas
55+
if rs.spec and rs.spec.replicas:
56+
break
5757
else:
58-
# Skip pods which do not have a ReplicaSet
58+
# Skip pods which do not have a ReplicaSet desiring replicas
5959
continue
6060
assert service.metadata, f"Encountered a service without metadata : {service}"
6161
assert pod.metadata, f"Encountered a pod without metadata : {pod}"

0 commit comments

Comments
 (0)