Skip to content

Commit

Permalink
fix: Remove tag manipulation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bryantbiggs committed Nov 28, 2023
1 parent 7ba6674 commit f0e7f3e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
20 changes: 1 addition & 19 deletions internal/service/eks/pod_identity_association.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (

// Function annotations are used for resource registration to the Provider. DO NOT EDIT.
// @FrameworkResource(name="Pod Identity Association")
// @Tags(identifierAttribute="association_id")
// @Tags(identifierAttribute="association_arn")
func newResourcePodIdentityAssociation(_ context.Context) (resource.ResourceWithConfigure, error) {
r := &resourcePodIdentityAssociation{}

Expand Down Expand Up @@ -195,16 +195,6 @@ func (r *resourcePodIdentityAssociation) Read(ctx context.Context, req resource.
return
}

tags, err := listTags(ctx, conn, data.AssociationArn.ValueString())

if err != nil {
resp.Diagnostics.AddError(fmt.Sprintf("listing tags for Pod Identity Association (%s)", data.AssociationId.ValueString()), err.Error())

return
}

setTagsOut(ctx, Tags(tags))

resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
}

Expand Down Expand Up @@ -252,14 +242,6 @@ func (r *resourcePodIdentityAssociation) Update(ctx context.Context, req resourc
plan.ModifiedAt = fwflex.StringToFramework(ctx, aws.String(out.Association.ModifiedAt.Format(time.RFC3339)))
}

if oldTagsAll, newTagsAll := state.TagsAll, plan.TagsAll; !newTagsAll.Equal(oldTagsAll) {
if err := updateTags(ctx, conn, plan.AssociationArn.ValueString(), oldTagsAll, newTagsAll); err != nil {
resp.Diagnostics.AddError(fmt.Sprintf("updating tags for Pod Identity Association (%s)", plan.AssociationId.ValueString()), err.Error())

return
}
}

resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...)
}

Expand Down
4 changes: 4 additions & 0 deletions internal/service/eks/pod_identity_association_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ resource "aws_eks_pod_identity_association" "test" {
namespace = %[1]q
service_account = "%[1]s-sa"
role_arn = aws_iam_role.test.arn
tags = {
Name = %[1]q
}
}
`, rName))
}
2 changes: 1 addition & 1 deletion internal/service/eks/service_package_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f0e7f3e

Please sign in to comment.