Skip to content

Commit

Permalink
cli: add force flag
Browse files Browse the repository at this point in the history
Deprecate no-precheck flag which is functionally the same as force(skips verification).

Closes #2436.

Signed-off-by: Ekaterina Pavlova <[email protected]>
  • Loading branch information
AliceInHunterland committed Aug 11, 2023
1 parent 41a07df commit 883dde9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ have been removed. Use `morph.endpoints` for both instead.
Deprecated `neofs_node_object_epoch` metric for IR and SN (the same for both)
has been removed. Use `neofs_node_state_epoch` for SN and `neofs_ir_state_epoch`
for IR instead.
Deprecated `--no-precheck` flag in `neofs-cli container set-eacl` use `--force` flag instead for skipping validation checks.

Subnets support has been removed:
- IR's `workers.subnet` and `contracts.subnet` configs are not used anymore.
Expand Down
6 changes: 4 additions & 2 deletions cmd/neofs-cli/modules/container/set_eacl.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ Container ID in EACL table will be substituted with ID from the CLI.`,

pk := key.GetOrGenerate(cmd)
cli := internalclient.GetSDKClientByFlag(ctx, cmd, commonflags.RPC)

if !flagVarsSetEACL.noPreCheck {
force, _ := cmd.Flags().GetBool(commonflags.ForceFlag)
if !(force || flagVarsSetEACL.noPreCheck) {
cmd.Println("Checking the ability to modify access rights in the container...")
common.PrintVerbose(cmd, "Reading the container to check ownership...")

Expand Down Expand Up @@ -144,5 +144,7 @@ func initContainerSetEACLCmd() {
flags.StringVar(&flagVarsSetEACL.srcPath, "table", "", "path to file with JSON or binary encoded EACL table")
flags.BoolVar(&containerAwait, "await", false, fmt.Sprintf("block execution until EACL is persisted. "+
"Increases default execution timeout to %.0fs", awaitTimeout.Seconds())) // simple %s notation prints 1m0s https://github.com/golang/go/issues/39064
flags.BoolP(commonflags.ForceFlag, commonflags.ForceFlagShorthand, false, "skip validation checks (ownership, extensibility of the container ACL)")
flags.BoolVar(&flagVarsSetEACL.noPreCheck, "no-precheck", false, "do not pre-check the extensibility of the container ACL")
_ = flags.MarkDeprecated("no-precheck", "use --force flag instead for skipping validation checks")
}

0 comments on commit 883dde9

Please sign in to comment.