-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix get iamserviceaccount returning error for unrelated CloudFormation Stack #8350
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
Fix get iamserviceaccount returning error for unrelated CloudFormation Stack #8350
Conversation
@@ -24,8 +24,8 @@ var _ = Describe("Get", func() { | |||
irsaManager = irsa.New("my-cluster", fakeStackManager, nil, nil) | |||
}) | |||
|
|||
When("no options are specified", func() { | |||
It("returns all service accounts", func() { | |||
When("no error occurs", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the logic that these tests covered is now in GetIAMServiceAccounts
, with test coverage in iam_test.go
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me! Thanks for both reducing/simplifying the actual code while adding additional tests! Wins all around.
Note you need to rebase this because of the conflicts with go.mod/go.sum that have changed since you made this |
Description
Fixes an issue where, if one IAM service account had errors creating,
eksctl get iamserviceaccount
would fail even when filtering for different service accounts. See issue report for more details: #8314Closes #8314
The problem was that the
manager
package'sGetIAMServiceAccounts
queried all CloudFormation stacks and returned an error for any service account that it finds, before filtering the service account based on the user's CLI filters.This PR moves the filtering prior to the error returning, meaning errors will only be returned if the error was in a stack that the user is including in their filter.
Checklist
README.md
, or theuserdocs
directory)area/nodegroup
) and kind (e.g.kind/improvement
)BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯