From 10497e913697741840278eb134efb6588a8b4f0a Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Fri, 28 Jun 2024 17:45:00 +0300 Subject: [PATCH] [#1213] cli: Do not allow to lock EC chunks Signed-off-by: Dmitrii Stepanov --- cmd/frostfs-cli/modules/object/util.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/frostfs-cli/modules/object/util.go b/cmd/frostfs-cli/modules/object/util.go index ff6b3219d..381c790e9 100644 --- a/cmd/frostfs-cli/modules/object/util.go +++ b/cmd/frostfs-cli/modules/object/util.go @@ -354,7 +354,7 @@ func collectObjectRelatives(cmd *cobra.Command, cli *client.Client, cnr cid.ID, Prepare(cmd, &prmHead) - _, err := internal.HeadObject(cmd.Context(), prmHead) + o, err := internal.HeadObject(cmd.Context(), prmHead) var errSplit *objectSDK.SplitInfoError var errEC *objectSDK.ECInfoError @@ -364,6 +364,9 @@ func collectObjectRelatives(cmd *cobra.Command, cli *client.Client, cnr cid.ID, commonCmd.ExitOnErr(cmd, "failed to get raw object header: %w", err) case err == nil: common.PrintVerbose(cmd, "Raw header received - object is singular.") + if ech := o.Header().ECHeader(); ech != nil { + commonCmd.ExitOnErr(cmd, "Lock EC chunk failed: %w", errors.ErrUnsupported) + } return nil case errors.As(err, &errSplit): common.PrintVerbose(cmd, "Split information received - object is virtual.")