[#1689] cli: Add split-header
option for object patch command
All checks were successful
Vulncheck / Vulncheck (push) Successful in 1m18s
Pre-commit hooks / Pre-commit (push) Successful in 1m38s
Build / Build Components (push) Successful in 1m40s
Tests and linters / Run gofumpt (push) Successful in 3m34s
Tests and linters / Lint (push) Successful in 3m46s
Tests and linters / Staticcheck (push) Successful in 3m56s
Tests and linters / Tests (push) Successful in 4m8s
Tests and linters / gopls check (push) Successful in 4m25s
OCI image / Build container images (push) Successful in 4m51s
Tests and linters / Tests with -race (push) Successful in 8m10s
All checks were successful
Vulncheck / Vulncheck (push) Successful in 1m18s
Pre-commit hooks / Pre-commit (push) Successful in 1m38s
Build / Build Components (push) Successful in 1m40s
Tests and linters / Run gofumpt (push) Successful in 3m34s
Tests and linters / Lint (push) Successful in 3m46s
Tests and linters / Staticcheck (push) Successful in 3m56s
Tests and linters / Tests (push) Successful in 4m8s
Tests and linters / gopls check (push) Successful in 4m25s
OCI image / Build container images (push) Successful in 4m51s
Tests and linters / Tests with -race (push) Successful in 8m10s
* Make `split-header` option read binary- or JSON-encoded split-header; * Use `PatchHeader` instead of `PatchAttributes`. Change-Id: I50ae1bd93d4695657249dacbea981199a39e1a35 Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
11493d587b
commit
2a6cdbdb72
2 changed files with 32 additions and 1 deletions
|
@ -858,6 +858,8 @@ type PatchObjectPrm struct {
|
|||
|
||||
ReplaceAttribute bool
|
||||
|
||||
NewSplitHeader *objectSDK.SplitHeader
|
||||
|
||||
PayloadPatches []PayloadPatch
|
||||
}
|
||||
|
||||
|
@ -888,7 +890,11 @@ func Patch(ctx context.Context, prm PatchObjectPrm) (*PatchRes, error) {
|
|||
return nil, fmt.Errorf("init payload reading: %w", err)
|
||||
}
|
||||
|
||||
if patcher.PatchAttributes(ctx, prm.NewAttributes, prm.ReplaceAttribute) {
|
||||
if patcher.PatchHeader(ctx, client.PatchHeaderPrm{
|
||||
NewSplitHeader: prm.NewSplitHeader,
|
||||
NewAttributes: prm.NewAttributes,
|
||||
ReplaceAttributes: prm.ReplaceAttribute,
|
||||
}) {
|
||||
for _, pp := range prm.PayloadPatches {
|
||||
payloadFile, err := os.OpenFile(pp.PayloadPath, os.O_RDONLY, os.ModePerm)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue