Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: IAM manager doesn't update trusts when multiple service accounts listed. #154

Closed
kevdowney opened this issue Oct 30, 2023 · 0 comments · Fixed by #155
Closed

bug: IAM manager doesn't update trusts when multiple service accounts listed. #154

kevdowney opened this issue Oct 30, 2023 · 0 comments · Fixed by #155
Assignees

Comments

@kevdowney
Copy link
Contributor

kevdowney commented Oct 30, 2023

Is this a BUG REPORT or FEATURE REQUEST?:
BUG
What happened:
When more then one irsa-service-account is listed the trust only picks up the last one.

apiVersion: iammanager.keikoproj.io/v1alpha1
kind: Iamrole
metadata:
  annotations:
    iam.amazonaws.com/irsa-service-account: default,my-service-account

We see in the IAM Role trusts only the last one is updated:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Federated": "arn:aws:iam::1234567890:oidc-provider/oidc.eks.us-west-2.amazonaws.com/id/EC888888xxxxxxx"
            },
            "Action": "sts:AssumeRoleWithWebIdentity",
            "Condition": {
                "StringEquals": {
                    "oidc.eks.us-west-2.amazonaws.com/id/EC888888xxxxxxx:sub": "system:serviceaccount:my-namespace:my-service-account"
                }
            }
        }
    ]
}

What you expected to happen:

  • 2 trusts should be entered for IAM Role, one for default and one for my-service-account

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:
This PR introduced this behavior, but doesn't handle multiple similar conditions.
We can just change the Id() method to handle condition, making sure we dereference as string.

Environment:

  • iam-manager version
  • Kubernetes version :
$ kubectl version -o yaml

Other debugging information (if applicable):

- controller logs:

$ kubectl logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant