From 13ced6105d8d9ffbecbcd533f4fda0c1f9a77260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Madis=20M=C3=A4gi?= Date: Sun, 28 Jul 2024 16:36:10 +0300 Subject: [PATCH] Fix oidc users reading --- inventory-app/common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inventory-app/common.py b/inventory-app/common.py index f4cda30..74ec9be 100644 --- a/inventory-app/common.py +++ b/inventory-app/common.py @@ -36,9 +36,9 @@ def get_users_inner(): ret = api_instance.list_namespaced_custom_object("codemowers.cloud", "v1beta1", OIDC_USERS_NAMESPACE, "oidcusers") for item in ret["items"]: username = item['metadata']['name'] - display_name = item.get("spec", {}).get("customProfile", {}).get("name", None) - slack_id = item.get("spec", {}).get("slackId", None) - user_type = item.get("spec", {}).get("type", None) + display_name = item.get("status", {}).get("profile", {}).get("name", None) + slack_id = item.get("status", {}).get("slackId", None) + user_type = item.get("spec", {}).get("type", None) #TODO: read from status when ready groups = [] for group in item.get("status", {}).get("groups", []): groups.append(f"{group['prefix']}:{group['name']}")