Skip to content

Commit

Permalink
address second round of feedback, includes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroniscode committed May 19, 2024
1 parent 0b4bbea commit 0119392
Show file tree
Hide file tree
Showing 3 changed files with 427 additions and 5 deletions.
7 changes: 4 additions & 3 deletions pkg/aws/services/tagging.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (t *latticeTagging) FindResourcesByTags(ctx context.Context, resourceType R
return nil, err
}

if containsTags(tags, resp.Tags) {
if containsTags(resp.Tags, tags) {
arns = append(arns, aws.StringValue(tg.Arn))
}
}
Expand All @@ -138,8 +138,9 @@ func (t *latticeTagging) FindResourcesByTags(ctx context.Context, resourceType R
}

func containsTags(source, check Tags) bool {
for k, v := range source {
if aws.StringValue(check[k]) != aws.StringValue(v) {
for k, v := range check {
sourceV, ok := source[k]
if !ok || aws.StringValue(sourceV) != aws.StringValue(v) {
return false
}
}
Expand Down
Loading

0 comments on commit 0119392

Please sign in to comment.