Skip to content

Commit

Permalink
address more feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroniscode committed May 23, 2024
1 parent 0119392 commit 5886139
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/aws/services/tagging.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func containsTags(source, check Tags) bool {
return false
}
}
return true
return len(check) != 0
}

func convertTags(tags []*taggingapi.Tag) Tags {
Expand Down
18 changes: 14 additions & 4 deletions pkg/aws/services/tagging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ func TestContainsTags(t *testing.T) {
"Key2": aws.String("Value2"),
},
sourceTags: Tags{
"Key1": aws.String("Value1"),
"Key2": aws.String("Value2"),
"Key3": aws.String("Value3"),
"Key2": aws.String("Value2"),
"Key1": aws.String("Value1"),
},
testName: "match subnet of tags from source's multiple tags",
testName: "match subset of tags from source's multiple tags",
},
{
contains: false,
Expand Down Expand Up @@ -112,6 +112,16 @@ func TestContainsTags(t *testing.T) {
sourceTags: Tags{},
testName: "no match for tag when source has no tags",
},
{
contains: false,
findTags: Tags{},
sourceTags: Tags{
"Key1": aws.String("Value1"),
"Key2": aws.String("Value2"),
"Key3": aws.String("Value3"),
},
testName: "no match when searching for empty tags",
},
{
contains: false,
findTags: Tags{
Expand Down Expand Up @@ -158,7 +168,7 @@ func Test_latticeTagging_FindResourcesByTags_nonTargetGroupTypeError(t *testing.
nonTargetGroupResourceType := ResourceTypeService

_, err := lt.FindResourcesByTags(ctx, nonTargetGroupResourceType, Tags{})
assert.NotNil(t, err)
assert.Error(t, err)
}

func Test_latticeTagging_FindResourcesByTags_ListTagsError(t *testing.T) {
Expand Down

0 comments on commit 5886139

Please sign in to comment.