Skip to content

Commit d47a1bc

Browse files
committed
hope based commit - changing logic of operator to compare arn instead of username
1 parent 5429735 commit d47a1bc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

kubernetes/auth-operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ spec:
2525
- --verbose
2626
- --liveness=http://0.0.0.0:8080/healthz
2727
- --standalone
28-
image: dcodetech/aws_auth_eks_crd:latest
28+
image: dcodetech/aws_auth_eks_crd:1.1.0
2929
imagePullPolicy: IfNotPresent
3030
name: operator
3131
ports:

src/kubernetes_operator/iam_mapping.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,14 @@ def ensure_identity(identity: dict, identity_list: list) -> list:
213213

214214
for i, existing_identity in enumerate(identity_list):
215215
# Handle existing identity
216-
if existing_identity["username"] == identity["username"]:
216+
if "rolearn" in existing_identity and existing_identity["rolearn"] == identity["rolearn"]:
217217
identity_list[i] = identity
218218
return identity_list
219+
220+
if "userarn" in existing_identity and existing_identity["userarn"] == identity["userarn"]:
221+
identity_list[i] = identity
222+
return identity_list
223+
219224
# Handle new identity
220225
identity_list.append(identity)
221226
return identity_list

0 commit comments

Comments
 (0)