From 79ba34714ab83b76bdfe1946b7ac3395bdd4296f Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Wed, 1 Mar 2023 10:52:41 +0300 Subject: [PATCH] [#79] cli: Fix panic when setting domain for container Signed-off-by: Anton Nikiforov --- cmd/frostfs-cli/modules/container/create.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/frostfs-cli/modules/container/create.go b/cmd/frostfs-cli/modules/container/create.go index 503059344..407309e97 100644 --- a/cmd/frostfs-cli/modules/container/create.go +++ b/cmd/frostfs-cli/modules/container/create.go @@ -7,6 +7,7 @@ import ( "strings" "time" + containerApi "github.com/TrueCloudLab/frostfs-api-go/v2/container" internalclient "github.com/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/client" "github.com/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/common" "github.com/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags" @@ -217,10 +218,12 @@ func parseAttributes(dst *container.Container, attributes []string) error { container.SetName(dst, containerName) } - var domain container.Domain - domain.SetName(containerNnsName) - domain.SetZone(containerNnsZone) - container.WriteDomain(dst, domain) + if containerNnsName != "" { + dst.SetAttribute(containerApi.SysAttributeName, containerNnsName) + } + if containerNnsZone != "" { + dst.SetAttribute(containerApi.SysAttributeZone, containerNnsZone) + } return nil }