-
Notifications
You must be signed in to change notification settings - Fork 20
Support Table
tags updates
#22
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
Conversation
Issue: aws-controllers-k8s/community#1029 This patch adds hooks and delta helpers to properly update Table tags. Description of changes: - Drop the generate updateTable function and use a custom one - Add hooks to properly compute the tags delta and make necessary API calls to update them - Add e2e tests for table tag updates
Note that the existing generated |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: A-Hilaly, vijtrip2 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Tags: sdkTagsFromResourceTags(added), | ||
}, | ||
) | ||
rm.metrics.RecordAPICall("GET", "UntagResource", err) |
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.
should be UPDATE not GET
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.
also, the operation ID should be "TagResource" not "UntagResource"
TagKeys: removed, | ||
}, | ||
) | ||
rm.metrics.RecordAPICall("GET", "UntagResource", err) |
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.
should be UPDATE not GET
func (rm *resourceManager) getResourceTagsPagesWithContext(ctx context.Context, resourceARN string) ([]*v1alpha1.Tag, error) { | ||
var err error | ||
rlog := ackrtlog.FromContext(ctx) | ||
exit := rlog.Trace("rm.getResourceTagsPagesWithContext") | ||
defer exit(err) | ||
|
||
tags := []*v1alpha1.Tag{} | ||
|
||
var token *string = nil | ||
for { | ||
var listTagsOfResourceOutput *svcsdk.ListTagsOfResourceOutput | ||
listTagsOfResourceOutput, err = rm.sdkapi.ListTagsOfResourceWithContext( | ||
ctx, | ||
&svcsdk.ListTagsOfResourceInput{ | ||
NextToken: token, | ||
ResourceArn: &resourceARN, | ||
}, | ||
) | ||
rm.metrics.RecordAPICall("GET", "ListTagsOfResource", err) | ||
if err != nil { | ||
return nil, err | ||
} | ||
tags = append(tags, resourceTagsFromSDKTags(listTagsOfResourceOutput.Tags)...) | ||
if listTagsOfResourceOutput.NextToken == nil { | ||
break | ||
} | ||
token = listTagsOfResourceOutput.NextToken | ||
} | ||
return tags, nil | ||
} |
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.
gotta love that ListTagsForResource
has no ListTagsForResourcePages
corresponding aws-sdk-go construct, like every other List operation does.... :/
Issue: aws-controllers-k8s/community#1029
This patch adds hooks and delta helpers to properly update Table tags.
Description of changes:
calls to update them
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license.