Fix oidc users reading
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Madis Mägi 2024-07-28 16:36:10 +03:00
parent c06db59898
commit 13ced6105d

View File

@ -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']}")