Skip to content

Commit

Permalink
bug repro
Browse files Browse the repository at this point in the history
  • Loading branch information
swgillespie committed Jan 19, 2024
1 parent d8db276 commit 487ba8a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/resources/namespace/namespace.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ resource "temporalcloud_namespace" "terraform" {
name = "terraform"
regions = ["aws-us-east-1"]
accepted_client_ca = base64encode(file("${path.module}/ca.pem"))
retention_days = 14
retention_days = 7
}
7 changes: 7 additions & 0 deletions internal/provider/namespace_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ func (r *namespaceResource) Schema(ctx context.Context, _ resource.SchemaRequest
},
"resource_version": schema.StringAttribute{
Computed: true,
PlanModifiers: []planmodifier.String{
stringplanmodifier.UseStateForUnknown(),
},
},
"certificate_filters": schema.ListNestedAttribute{
Optional: true,
Expand Down Expand Up @@ -263,6 +266,10 @@ func (r *namespaceResource) Update(ctx context.Context, req resource.UpdateReque
if resp.Diagnostics.HasError() {
return
}

tflog.Debug(ctx, "running update with resource version", map[string]any{
"resource_version": plan.ResourceVersion.ValueString(),
})
svcResp, err := r.client.UpdateNamespace(ctx, &cloudservicev1.UpdateNamespaceRequest{
Namespace: plan.ID.ValueString(),
Spec: &namespacev1.NamespaceSpec{
Expand Down
4 changes: 1 addition & 3 deletions internal/provider/namespace_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,10 @@ PEM
// New namespace with retention of 7
Config: config("tf-basic-namespace", 7),
},
/* Does not work yet: CLD-1971
{
// Update retention to 14
Config: testAccBasicNamespaceConfig("terraform-test", 14),
Config: config("terraform-test", 14),
},
*/
// Delete testing automatically occurs in TestCase
},
})
Expand Down

0 comments on commit 487ba8a

Please sign in to comment.