Skip to content

Commit

Permalink
Support no group
Browse files Browse the repository at this point in the history
  • Loading branch information
Francis Mireault committed Jun 5, 2023
1 parent 6bb7274 commit 5af966e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/kubernetes_operator/iam_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async def create_mapping(spec: dict, diff: list, **_) -> None:
configmap = API.read_namespaced_config_map("aws-auth", "kube-system")

arn_field = spec["userarn"] if spec.get("userarn") else spec["rolearn"]
logger.info("Mapping for user %s as %s to %s", arn_field, spec["username"], spec["groups"])
logger.info("Mapping for user %s as %s to %s", arn_field, spec["username"], spec.get("groups", "(no group)"))

identities = get_cm_identity_mappings(configmap)
updated_mapping = ensure_identity(sanitize_spec, identities)
Expand All @@ -74,7 +74,7 @@ async def delete_mapping(spec: dict, **_) -> None:
configmap = API.read_namespaced_config_map("aws-auth", "kube-system")

arn_field = spec["userarn"] if spec.get("userarn") else spec["rolearn"]
logger.info("Delete mapping for user %s as %s to %s", arn_field, spec["username"], spec["groups"])
logger.info("Delete mapping for user %s as %s to %s", arn_field, spec["username"], spec.get("groups", "(no group)"))

identity_mappings = get_cm_identity_mappings(configmap)
updated_mappings = delete_identity(spec, identity_mappings)
Expand Down

0 comments on commit 5af966e

Please sign in to comment.