Skip to content

Commit

Permalink
Merge pull request #23 from coveooss/def-1334
Browse files Browse the repository at this point in the history
def-1334: support no group
  • Loading branch information
maxpoirier authored Jun 6, 2023
2 parents 6bb7274 + 5af966e commit c757042
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 c757042

Please sign in to comment.