Ocean Framework Version
0.38.20
Integration Version
0.2.26 (ghcr.io/port-labs/port-ocean-argocd:latest)
Steps to reproduce
- Register two or more clusters in ArgoCD
- Deploy applications to only some clusters — leave at least one cluster with zero applications
- Trigger a resync of the ArgoCD integration
What did you expect to see?
Resync completes successfully. Clusters with no applications are treated as returning an empty list and skipped gracefully.
What did you see instead?
Resync fails with 'NoneType' object is not iterable. No entities are synced to Port and the
integration logs "Resync failed with N errors, skipping delete phase due to incomplete state".
The ArgoCD API returns {"items": null} (not {"items": []}) for clusters with no applications.
get_paginated_resources uses response_data.get("items", []) which only falls back to the default
when the key is absent — when the key is present with a null value it returns None, and
batched(None, PAGE_SIZE) raises TypeError.
The fix is a one-character change on client.py line 108:
# broken
for batch in batched(response_data.get("items", []), PAGE_SIZE):
# fixed — handles both absent key and explicit null
for batch in batched(response_data.get("items") or [], PAGE_SIZE):
This pattern is already used correctly in get_resources (line 85):
return response_data["items"] or []
Full traceback:
File "/app/client.py", line 108, in get_paginated_resources
for batch in batched(response_data.get("items", []), PAGE_SIZE):
Exception: 'NoneType' object is not iterable
Are you willing to submit a PR?
Ocean Framework Version
0.38.20
Integration Version
0.2.26 (ghcr.io/port-labs/port-ocean-argocd:latest)
Steps to reproduce
What did you expect to see?
Resync completes successfully. Clusters with no applications are treated as returning an empty list and skipped gracefully.
What did you see instead?
Resync fails with 'NoneType' object is not iterable. No entities are synced to Port and the
integration logs "Resync failed with N errors, skipping delete phase due to incomplete state".
The ArgoCD API returns {"items": null} (not {"items": []}) for clusters with no applications.
get_paginated_resources uses response_data.get("items", []) which only falls back to the default
when the key is absent — when the key is present with a null value it returns None, and
batched(None, PAGE_SIZE) raises TypeError.
The fix is a one-character change on client.py line 108:
This pattern is already used correctly in get_resources (line 85):
return response_data["items"] or []
Full traceback:
File "/app/client.py", line 108, in get_paginated_resources
for batch in batched(response_data.get("items", []), PAGE_SIZE):
Exception: 'NoneType' object is not iterable
Are you willing to submit a PR?