Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
ganievs committed Dec 13, 2023
1 parent 97ee12e commit b66afeb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 56 deletions.
2 changes: 1 addition & 1 deletion docs/resources/namespace.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ resource "temporal_namespace" "example" {
### Required

- `name` (String) Namespace name
- `owner_email` (String) Namespace Owner Email

### Optional

Expand All @@ -34,7 +35,6 @@ resource "temporal_namespace" "example" {
- `history_archival_state` (String) History Archival State
- `history_archival_uri` (String) History Archival URI
- `is_global_namespace` (Boolean) Namespace is Global
- `owner_email` (String) Namespace Owner Email
- `retention` (Number) Workflow Execution retention
- `visibility_archival_state` (String) Visibility Archival State
- `visibility_archival_uri` (String) Visibility Archival URI
Expand Down
43 changes: 0 additions & 43 deletions examples/provider-install-verification/main.tf.test

This file was deleted.

14 changes: 2 additions & 12 deletions internal/provider/namespace_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ func (r *NamespaceResource) Schema(ctx context.Context, req resource.SchemaReque
},
"owner_email": schema.StringAttribute{
MarkdownDescription: "Namespace Owner Email",
Optional: true,
Computed: true,
Default: stringdefault.StaticString(""),
Required: true,
},
"retention": schema.Int64Attribute{
MarkdownDescription: "Workflow Execution retention",
Expand Down Expand Up @@ -300,7 +298,7 @@ func (r *NamespaceResource) Update(ctx context.Context, req resource.UpdateReque
PromoteNamespace: data.IsGlobalNamespace.ValueBool(),
}

_, err := client.UpdateNamespace(ctx, request)
ns, err := client.UpdateNamespace(ctx, request)
if err != nil {
if _, ok := err.(*serviceerror.NamespaceAlreadyExists); !ok {
resp.Diagnostics.AddError("Request error", "namespace registration failed: "+err.Error())
Expand All @@ -314,14 +312,6 @@ func (r *NamespaceResource) Update(ctx context.Context, req resource.UpdateReque
tflog.Info(ctx, fmt.Sprintf("The namespace: %s is successfully registered", data.Name))
tflog.Trace(ctx, "created a resource")

ns, err := client.DescribeNamespace(ctx, &workflowservice.DescribeNamespaceRequest{
Namespace: data.Name.ValueString(),
})
if err != nil {
resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to read Namespace info, got error: %s", err))
return
}

data = NamespaceResourceModel{
Name: types.StringValue(ns.NamespaceInfo.GetName()),
Id: types.StringValue(ns.NamespaceInfo.GetId()),
Expand Down

0 comments on commit b66afeb

Please sign in to comment.