From 88e3868f47a4761adec29804850c4846bcc27681 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Wed, 22 Feb 2023 16:09:18 +0300 Subject: [PATCH] [#37] cli: Add `nns-name` and `nns-zone` for `container create` Signed-off-by: Anton Nikiforov --- CHANGELOG.md | 1 + cmd/frostfs-cli/modules/container/create.go | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bf7ee9b5..4a6324756 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ Changelog for FrostFS Node - `object.delete.tombstone_lifetime` config parameter to set tombstone lifetime in the DELETE service (#2246) - Reload config for pprof and metrics on SIGHUP in `neofs-node` (#1868) - Multiple configs support (#44) +- Parameters `nns-name` and `nns-zone` for command `frostfs-cli container create` (#37) ### Changed - Change `frostfs_node_engine_container_size` to counting sizes of logical objects diff --git a/cmd/frostfs-cli/modules/container/create.go b/cmd/frostfs-cli/modules/container/create.go index 9a77e8727..930529efb 100644 --- a/cmd/frostfs-cli/modules/container/create.go +++ b/cmd/frostfs-cli/modules/container/create.go @@ -26,6 +26,8 @@ var ( containerAttributes []string containerAwait bool containerName string + containerNnsName string + containerNnsZone string containerNoTimestamp bool containerSubnet string force bool @@ -160,6 +162,8 @@ func initContainerCreateCmd() { flags.StringSliceVarP(&containerAttributes, "attributes", "a", nil, "Comma separated pairs of container attributes in form of Key1=Value1,Key2=Value2") flags.BoolVar(&containerAwait, "await", false, "Block execution until container is persisted") flags.StringVar(&containerName, "name", "", "Container name attribute") + flags.StringVar(&containerNnsName, "nns-name", "", "Container nns name attribute") + flags.StringVar(&containerNnsZone, "nns-zone", "", "Container nns zone attribute") flags.BoolVar(&containerNoTimestamp, "disable-timestamp", false, "Disable timestamp container attribute") flags.StringVar(&containerSubnet, "subnet", "", "String representation of container subnetwork") flags.BoolVarP(&force, commonflags.ForceFlag, commonflags.ForceFlagShorthand, false, @@ -213,5 +217,10 @@ 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) + return nil }