Add support for specifying wellKnownPolicies when using addons#4161
Add support for specifying wellKnownPolicies when using addons#4161aclevername merged 7 commits intoeksctl-io:mainfrom
Conversation
0535a16 to
255b326
Compare
ed88a16 to
695ce78
Compare
695ce78 to
8519a71
Compare
| resourceSet = builder.NewIAMRoleResourceSetWithAttachPolicy(addon.Name, namespace, serviceAccount, addon.PermissionsBoundary, addon.AttachPolicy, a.oidcManager) | ||
| } | ||
| return resourceSet.OutputRole, nil | ||
| return resourceSet, resourceSet.AddAllResources() |
There was a problem hiding this comment.
This is so weird. It returns the resource, but then also returns the output of calling AddAllResources on the created resource. The cognitive load of this "simple" function is pretty high. I would prefer this to be separated and the caller has the responsibility to further add all resources if necessary. The createroleResourceSet doesn't suggest that this will also add all of them. It suggest construction.
There was a problem hiding this comment.
I think whats weird is how the resourceSets work. You use a constructor to "build" it, but its only actually build it/becomes useful after you've called AddAllResources. I could move this call further up, but its just moving the error handling around even more 🤷
There was a problem hiding this comment.
Ah, well that's annoying. :D Fine, leave it as is :)
Skarlso
left a comment
There was a problem hiding this comment.
One question / note. Otherwise the generated function and logic look okay to me. I'm not sure though if anything might be missing from somewhere. In my limited understanding of the current code structure and focal points of eksctl this looks okay. :)
Description
Closes #4158
Checklist
README.md, or theuserdocsdirectory)area/nodegroup) and kind (e.g.kind/improvement)BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯