From 92ab0ee1a260937fcc0309109c8bf54c44158f24 Mon Sep 17 00:00:00 2001 From: Shamil Ganiev Date: Wed, 13 Dec 2023 15:38:21 +0400 Subject: [PATCH] up doc --- internal/provider/namespace_data_source.go | 3 +-- internal/provider/namespace_resource.go | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/provider/namespace_data_source.go b/internal/provider/namespace_data_source.go index 965d436..2ced3f2 100644 --- a/internal/provider/namespace_data_source.go +++ b/internal/provider/namespace_data_source.go @@ -151,8 +151,7 @@ func (d *NamespaceDataSource) Read(ctx context.Context, req datasource.ReadReque tflog.Trace(ctx, "read a data source") - var data *NamespaceDataSourceModel - data = &NamespaceDataSourceModel{ + data := &NamespaceDataSourceModel{ Name: types.StringValue(ns.NamespaceInfo.GetName()), Id: types.StringValue(ns.NamespaceInfo.GetId()), Description: types.StringValue(ns.NamespaceInfo.GetDescription()), diff --git a/internal/provider/namespace_resource.go b/internal/provider/namespace_resource.go index e6dc4ed..4edef88 100644 --- a/internal/provider/namespace_resource.go +++ b/internal/provider/namespace_resource.go @@ -197,10 +197,9 @@ func (r *NamespaceResource) Create(ctx context.Context, req resource.CreateReque if _, ok := err.(*serviceerror.NamespaceAlreadyExists); !ok { resp.Diagnostics.AddError("Request error", "namespace registration failed: "+err.Error()) return - } else { - resp.Diagnostics.AddError(data.Name.ValueString(), "namespace is already registered: "+err.Error()) - return } + resp.Diagnostics.AddError(data.Name.ValueString(), "namespace is already registered: "+err.Error()) + return } tflog.Info(ctx, fmt.Sprintf("The namespace: %s is successfully registered", data.Name))