Skip to content

Commit e0bbb1b

Browse files
rnetserdbasunag
authored andcommitted
is_managed_cluster fix condition (opendatahub-io#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 e94cede commit e0bbb1b

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
@@ -376,10 +376,11 @@ def is_managed_cluster(client: DynamicClient) -> bool:
376376

377377
platform_statuses = infra.instance.status.platformStatus
378378

379-
for entries in platform_statuses.values():
380-
if isinstance(entries, kubernetes.dynamic.resource.ResourceField):
381-
if tags := entries.resourceTags:
382-
return next(b["value"] == "true" for b in tags if b["key"] == "red-hat-managed")
379+
for entry in platform_statuses.values():
380+
if isinstance(entry, kubernetes.dynamic.resource.ResourceField):
381+
if tags := entry.resourceTags:
382+
LOGGER.info(f"Infrastructure {infra.name} resource tags: {tags}")
383+
return any([tag["value"] == "true" for tag in tags if tag["key"] == "red-hat-managed"])
383384

384385
return False
385386

0 commit comments

Comments
 (0)