Skip to content

Commit

Permalink
v0.0.20 - Update libs for HTTP retries & use SetId
Browse files Browse the repository at this point in the history
* Update to lib version 0.0.13 (fixes HTTP retry conditions)
* Call SetId("") when a resource is not found to indicate to Terraform that it should recreate
  • Loading branch information
evanverneyfink committed Oct 12, 2022
1 parent e9f4632 commit 2dbc245
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.idea
vendor
bin

terraform-provider-mcma.exe
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/ebu/terraform-provider-mcma
go 1.18

require (
github.com/ebu/mcma-libraries-go v0.0.10
github.com/ebu/mcma-libraries-go v0.0.13
github.com/hashicorp/terraform-plugin-docs v0.7.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.13.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/ebu/mcma-libraries-go v0.0.10 h1:/1NuRPq+5saXLOScvv2Gydfg9HjKqE8gXsC1eFTGlYY=
github.com/ebu/mcma-libraries-go v0.0.10/go.mod h1:RnT/sTbg7ICp6NHDxyj/xX9xI+bqbcm9SUkPTIJnqs4=
github.com/ebu/mcma-libraries-go v0.0.13 h1:UgJcM/54947ZllMuqwxsSPqBqSlXfLIvkTucjI0e2Rs=
github.com/ebu/mcma-libraries-go v0.0.13/go.mod h1:RnT/sTbg7ICp6NHDxyj/xX9xI+bqbcm9SUkPTIJnqs4=
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
Expand Down
2 changes: 1 addition & 1 deletion mcma/resource_job_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func resourceJobProfileRead(_ context.Context, d *schema.ResourceData, m interfa
return diag.Errorf("error getting job profile with id %s: %s", jobProfileId, err)
}
if resource == nil {
_ = d.Set("id", "")
d.SetId("")
return diag.Diagnostics{}
}

Expand Down
2 changes: 1 addition & 1 deletion mcma/resource_mcma_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func resourceMcmaResourceRead(_ context.Context, d *schema.ResourceData, m inter
return diag.Errorf("error getting resource of type %s with id %s: %s", resourceType, resourceId, err)
}
if resource == nil {
_ = d.Set("id", "")
d.SetId("")
return diag.Diagnostics{}
}

Expand Down
3 changes: 1 addition & 2 deletions mcma/resource_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ func resourceService() *schema.Resource {
Type: schema.TypeString,
Description: "The ID of the service. MCMA IDs are always absolute urls.",
Computed: true,
ForceNew: true,
},
"date_created": {
Type: schema.TypeString,
Expand Down Expand Up @@ -153,7 +152,7 @@ func resourceServiceRead(_ context.Context, d *schema.ResourceData, m interface{
return diag.Errorf("error getting service with id %s: %s", serviceId, err)
}
if resource == nil {
_ = d.Set("id", "")
d.SetId("")
return diag.Diagnostics{}
}

Expand Down

0 comments on commit 2dbc245

Please sign in to comment.