From 2dbc245f97af4f46c01835a405ede49a136f1292 Mon Sep 17 00:00:00 2001 From: Evan Verney-Fink <9777656+evanverneyfink@users.noreply.github.com> Date: Wed, 12 Oct 2022 10:24:14 -0400 Subject: [PATCH] v0.0.20 - Update libs for HTTP retries & use SetId * 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 --- .gitignore | 2 ++ go.mod | 2 +- go.sum | 4 ++-- mcma/resource_job_profile.go | 2 +- mcma/resource_mcma_resource.go | 2 +- mcma/resource_service.go | 3 +-- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index f58cbb3..48cdc50 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .idea vendor bin + +terraform-provider-mcma.exe diff --git a/go.mod b/go.mod index be163fe..4fd0f98 100644 --- a/go.mod +++ b/go.mod @@ -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 ) diff --git a/go.sum b/go.sum index d43cac3..17e924c 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/mcma/resource_job_profile.go b/mcma/resource_job_profile.go index 95eaff9..6438dc0 100644 --- a/mcma/resource_job_profile.go +++ b/mcma/resource_job_profile.go @@ -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{} } diff --git a/mcma/resource_mcma_resource.go b/mcma/resource_mcma_resource.go index 15b90b8..4851c63 100644 --- a/mcma/resource_mcma_resource.go +++ b/mcma/resource_mcma_resource.go @@ -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{} } diff --git a/mcma/resource_service.go b/mcma/resource_service.go index ea3bbea..e1a869b 100644 --- a/mcma/resource_service.go +++ b/mcma/resource_service.go @@ -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, @@ -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{} }