Skip to content

Commit

Permalink
Merge pull request #25772 from hashicorp/td-networkmanager-tidyup
Browse files Browse the repository at this point in the history
service/Network Manager: Use `UpdateTagsWithContext`
  • Loading branch information
ewbankkit authored Jul 11, 2022
2 parents 45d2c96 + 3de5301 commit f79cc52
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 27 deletions.
2 changes: 1 addition & 1 deletion internal/service/networkmanager/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func resourceConnectionUpdate(ctx context.Context, d *schema.ResourceData, meta
if d.HasChange("tags_all") {
o, n := d.GetChange("tags_all")

if err := UpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
if err := UpdateTagsWithContext(ctx, conn, d.Get("arn").(string), o, n); err != nil {
return diag.Errorf("error updating Network Manager Connection (%s) tags: %s", d.Id(), err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/service/networkmanager/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func resourceDeviceUpdate(ctx context.Context, d *schema.ResourceData, meta inte
if d.HasChange("tags_all") {
o, n := d.GetChange("tags_all")

if err := UpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
if err := UpdateTagsWithContext(ctx, conn, d.Get("arn").(string), o, n); err != nil {
return diag.Errorf("error updating Network Manager Device (%s) tags: %s", d.Id(), err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/service/networkmanager/generate.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:generate go run ../../generate/tags/main.go -ListTags -ListTagsOutTagsElem=TagList -ServiceTagsSlice -UpdateTags
//go:generate go run ../../generate/tags/main.go -ServiceTagsSlice -UpdateTags
// ONLY generate directives and package declaration! Do not add anything else to this file.

package networkmanager
2 changes: 1 addition & 1 deletion internal/service/networkmanager/global_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func resourceGlobalNetworkUpdate(ctx context.Context, d *schema.ResourceData, me
if d.HasChange("tags_all") {
o, n := d.GetChange("tags_all")

if err := UpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
if err := UpdateTagsWithContext(ctx, conn, d.Get("arn").(string), o, n); err != nil {
return diag.Errorf("error updating Network Manager Global Network (%s) tags: %s", d.Id(), err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/service/networkmanager/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func resourceLinkUpdate(ctx context.Context, d *schema.ResourceData, meta interf
if d.HasChange("tags_all") {
o, n := d.GetChange("tags_all")

if err := UpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
if err := UpdateTagsWithContext(ctx, conn, d.Get("arn").(string), o, n); err != nil {
return diag.Errorf("error updating Network Manager Link (%s) tags: %s", d.Id(), err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/service/networkmanager/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func resourceSiteUpdate(ctx context.Context, d *schema.ResourceData, meta interf
if d.HasChange("tags_all") {
o, n := d.GetChange("tags_all")

if err := UpdateTags(conn, d.Get("arn").(string), o, n); err != nil {
if err := UpdateTagsWithContext(ctx, conn, d.Get("arn").(string), o, n); err != nil {
return diag.Errorf("error updating Network Manager Site (%s) tags: %s", d.Id(), err)
}
}
Expand Down
21 changes: 0 additions & 21 deletions internal/service/networkmanager/tags_gen.go

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

0 comments on commit f79cc52

Please sign in to comment.