Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump client api version to 2024-05-13-00 #134

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (

const TemporalCloudAPIVersionHeader = "temporal-cloud-api-version"

var TemporalCloudAPIVersion = "2023-10-01-00"
var TemporalCloudAPIVersion = "2024-05-13-00"

// Client is a client for the Temporal Cloud API.
type Client struct {
Expand Down
30 changes: 18 additions & 12 deletions internal/provider/namespace_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,16 +278,19 @@ func (r *namespaceResource) Create(ctx context.Context, req resource.CreateReque
return
}
}
mtls := &namespacev1.MtlsAuthSpec{}
if plan.AcceptedClientCA.ValueString() != "" {
mtls.Enabled = true
mtls.AcceptedClientCa = plan.AcceptedClientCA.ValueString()
mtls.CertificateFilters = certFilters
}
svcResp, err := r.client.CloudService().CreateNamespace(ctx, &cloudservicev1.CreateNamespaceRequest{
Spec: &namespacev1.NamespaceSpec{
Name: plan.Name.ValueString(),
Regions: regions,
RetentionDays: int32(plan.RetentionDays.ValueInt64()),
MtlsAuth: &namespacev1.MtlsAuthSpec{
AcceptedClientCa: plan.AcceptedClientCA.ValueString(),
CertificateFilters: certFilters,
},
CodecServer: codecServer,
MtlsAuth: mtls,
CodecServer: codecServer,
},
})
if err != nil {
Expand Down Expand Up @@ -360,16 +363,19 @@ func (r *namespaceResource) Update(ctx context.Context, req resource.UpdateReque
if resp.Diagnostics.HasError() {
return
}
mtls := &namespacev1.MtlsAuthSpec{}
if plan.AcceptedClientCA.ValueString() != "" {
mtls.Enabled = true
mtls.AcceptedClientCa = plan.AcceptedClientCA.ValueString()
mtls.CertificateFilters = certFilters
}
svcResp, err := r.client.CloudService().UpdateNamespace(ctx, &cloudservicev1.UpdateNamespaceRequest{
Namespace: plan.ID.ValueString(),
Spec: &namespacev1.NamespaceSpec{
Name: plan.Name.ValueString(),
Regions: regions,
RetentionDays: int32(plan.RetentionDays.ValueInt64()),
MtlsAuth: &namespacev1.MtlsAuthSpec{
AcceptedClientCa: plan.AcceptedClientCA.ValueString(),
CertificateFilters: certFilters,
},
Name: plan.Name.ValueString(),
Regions: regions,
RetentionDays: int32(plan.RetentionDays.ValueInt64()),
MtlsAuth: mtls,
CodecServer: codecServer,
CustomSearchAttributes: currentNs.GetNamespace().GetSpec().GetCustomSearchAttributes(),
},
Expand Down
10 changes: 5 additions & 5 deletions internal/provider/namespace_search_attribute_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ PEM
resource "temporalcloud_namespace_search_attribute" "custom_search_attribute" {
namespace_id = temporalcloud_namespace.terraform.id
name = "%s"
type = "Text"
type = "text"
}

resource "temporalcloud_namespace_search_attribute" "custom_search_attribute2" {
namespace_id = temporalcloud_namespace.terraform.id
name = "CustomSearchAttribute2"
type = "Text"
type = "text"
}

resource "temporalcloud_namespace_search_attribute" "custom_search_attribute3" {
namespace_id = temporalcloud_namespace.terraform.id
name = "CustomSearchAttribute3"
type = "Text"
type = "text"
}`, name, saName)
}

Expand Down Expand Up @@ -102,7 +102,7 @@ PEM
resource "temporalcloud_namespace_search_attribute" "custom_search_attribute" {
namespace_id = temporalcloud_namespace.terraform.id
name = "%s"
type = "Text"
type = "text"
}
`, name, saName)
}
Expand Down Expand Up @@ -159,7 +159,7 @@ PEM
resource "temporalcloud_namespace_search_attribute" "custom_search_attribute" {
namespace_id = temporalcloud_namespace.terraform.id
name = "CustomSearchAttribute"
type = "Text"
type = "text"
}
`, name, retentionDays)
}
Expand Down
Loading