Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create named container from CLI #2950

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ Changelog for NeoFS Node

### Fixed
- Do not search for tombstones when handling their expiration, use local indexes instead (#2929)
- `defer` func is not skipped in cobra-based programs (#2942)

### Changed
- `ObjectService`'s `Put` RPC handler caches up to 10K lists of per-object sorted container nodes (#2901)
- Metabase graveyard scheme (#2929)
- When an error is returned, no additional help output is displayed in cobra-based programs (#2942)
- For `neofs-cli container create`, `--name` flag sets also `__NEOFS__NAME` attribute, which
is used for container domain name in NNS contracts (#2950)

### Removed

Expand Down
6 changes: 5 additions & 1 deletion cmd/neofs-cli/modules/container/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
flags.StringSliceVarP(&containerAttributes, "attributes", "a", nil, "Comma separated pairs of container attributes in form of Key1=Value1,Key2=Value2")
flags.BoolVar(&containerAwait, "await", false, fmt.Sprintf("Block execution until container is persisted. "+
"Increases default execution timeout to %.0fs", awaitTimeout.Seconds())) // simple %s notation prints 1m0s https://github.com/golang/go/issues/39064
flags.StringVar(&containerName, "name", "", "Container name attribute")
flags.StringVar(&containerName, "name", "", "Container name attribute and domain name attribute, that is registered with the default zone in NNS contract")

Check warning on line 184 in cmd/neofs-cli/modules/container/create.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/container/create.go#L184

Added line #L184 was not covered by tests
flags.BoolVar(&containerNoTimestamp, "disable-timestamp", false, "Disable timestamp container attribute")
flags.BoolVarP(&force, commonflags.ForceFlag, commonflags.ForceFlagShorthand, false,
"Skip placement validity check")
Expand Down Expand Up @@ -232,6 +232,10 @@

if containerName != "" {
dst.SetName(containerName)

var d container.Domain
d.SetName(containerName)
dst.WriteDomain(d)

Check warning on line 238 in cmd/neofs-cli/modules/container/create.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-cli/modules/container/create.go#L236-L238

Added lines #L236 - L238 were not covered by tests
}

return nil
Expand Down
Loading