forked from TrueCloudLab/frostfs-node
[#79] cli: Fix panic when setting domain for container
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
parent
6d4f48f37a
commit
79ba34714a
1 changed files with 7 additions and 4 deletions
|
@ -7,6 +7,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
containerApi "github.com/TrueCloudLab/frostfs-api-go/v2/container"
|
||||||
internalclient "github.com/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/client"
|
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/common"
|
||||||
"github.com/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags"
|
"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)
|
container.SetName(dst, containerName)
|
||||||
}
|
}
|
||||||
|
|
||||||
var domain container.Domain
|
if containerNnsName != "" {
|
||||||
domain.SetName(containerNnsName)
|
dst.SetAttribute(containerApi.SysAttributeName, containerNnsName)
|
||||||
domain.SetZone(containerNnsZone)
|
}
|
||||||
container.WriteDomain(dst, domain)
|
if containerNnsZone != "" {
|
||||||
|
dst.SetAttribute(containerApi.SysAttributeZone, containerNnsZone)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue