Skip to content

Commit 1ceeda5

Browse files
authored
is_managed_cluster fix condition (#243)
* Create size-labeler.yml * Delete .github/workflows/size-labeler.yml * model mesh - add auth tests * xx * fix: replace iter with list * fix: add logger info
1 parent 656d8d1 commit 1ceeda5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

utilities/infra.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,11 @@ def is_managed_cluster(client: DynamicClient) -> bool:
368368

369369
platform_statuses = infra.instance.status.platformStatus
370370

371-
for entries in platform_statuses.values():
372-
if isinstance(entries, kubernetes.dynamic.resource.ResourceField):
373-
if tags := entries.resourceTags:
374-
return next(b["value"] == "true" for b in tags if b["key"] == "red-hat-managed")
371+
for entry in platform_statuses.values():
372+
if isinstance(entry, kubernetes.dynamic.resource.ResourceField):
373+
if tags := entry.resourceTags:
374+
LOGGER.info(f"Infrastructure {infra.name} resource tags: {tags}")
375+
return any([tag["value"] == "true" for tag in tags if tag["key"] == "red-hat-managed"])
375376

376377
return False
377378

0 commit comments

Comments
 (0)