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
Add tags management to OpenIDConnectProvider (iam) #1059
Add tags management to OpenIDConnectProvider (iam) #1059
Conversation
I'm opening a draft PR because I added a testing structure to explicitly test the aws input structs involved in the tag and untag operations, and for best readability, I split the tests for the Update method (related to specifically update tags) in a separate test function, and I would like to have some feedback on this before finalizing the PR. In particular, if the proposed testing approach is accepted, I'm keen to introduce the same to the others operations on the other attributes (thumbprint, ClientID), maybe in separate PRs to help the review? |
@muvaf FYI |
d04ef91
to
d85a39e
Compare
1f97c9d
to
2f81cd8
Compare
Fixes: #1133 |
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.
lgtm
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.
Thanks @cebernardi ! Left a couple of comments but should be good to merge once they are addressed. Let me know when it's ready to go!
// to current and desired states; | ||
// tags that have changed will be returned in the addOrUpdate return parameter, but not included in the `remove` return parameters | ||
// it also returns if desired state needs to be updated | ||
func DiffIAMTagsWithUpdates(local []v1beta1.Tag, remote []iamtypes.Tag) (addOrUpdate []iamtypes.Tag, remove []string, areTagsUpToDate bool) { |
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.
Shouldn't we use this for all cases? Do other API endpoints in IAM return error when you call Tag
for an existing tag?
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.
yes, I think we should always use this semantic, as in all the AWS docs I've read, if you call Tag
with an existing key but a different value, it overrides the value (as expected, I would say).
But all the other resources are using a remove tag / add tag semantic, and I wanted to keep the scope of this PR to the bare minimum.
I'll be happy to address it on a separate PR?
@@ -20,6 +20,11 @@ import ( | |||
"context" | |||
"testing" | |||
|
|||
"github.com/google/go-cmp/cmp/cmpopts" |
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.
Import grouping.
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.
I gave it a try, hoping I got it right...
40a9cc3
to
d72929d
Compare
Signed-off-by: Cecilia Bernardi <cbernardi@expediagroup.com>
d72929d
to
7dad1bb
Compare
Description of your changes
Added tags management to OpenIDConnectProvider.
Fixes #
I have:
make reviewable test
to ensure this PR is ready for review.How has this code been tested
This PR was tested by: