[#1394] putSvc: Fix relay
All checks were successful
Tests and linters / Run gofumpt (pull_request) Successful in 1m44s
DCO action / DCO (pull_request) Successful in 1m58s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m37s
Vulncheck / Vulncheck (pull_request) Successful in 3m11s
Tests and linters / Staticcheck (pull_request) Successful in 3m26s
Tests and linters / Lint (pull_request) Successful in 3m33s
Build / Build Components (pull_request) Successful in 3m42s
Tests and linters / gopls check (pull_request) Successful in 4m8s
Tests and linters / Tests (pull_request) Successful in 5m46s
Tests and linters / Tests with -race (pull_request) Successful in 7m31s
All checks were successful
Tests and linters / Run gofumpt (pull_request) Successful in 1m44s
DCO action / DCO (pull_request) Successful in 1m58s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m37s
Vulncheck / Vulncheck (pull_request) Successful in 3m11s
Tests and linters / Staticcheck (pull_request) Successful in 3m26s
Tests and linters / Lint (pull_request) Successful in 3m33s
Build / Build Components (pull_request) Successful in 3m42s
Tests and linters / gopls check (pull_request) Successful in 4m8s
Tests and linters / Tests (pull_request) Successful in 5m46s
Tests and linters / Tests with -race (pull_request) Successful in 7m31s
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
772b471aab
commit
a5e1aa22c9
3 changed files with 7 additions and 6 deletions
|
@ -13,16 +13,16 @@ import (
|
|||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user"
|
||||
)
|
||||
|
||||
func New(prm *objectwriter.Params) (transformer.ChunkedObjectWriter, error) {
|
||||
func New(prm objectwriter.Params) (transformer.ChunkedObjectWriter, error) {
|
||||
// prepare needed put parameters
|
||||
if err := preparePrm(prm); err != nil {
|
||||
if err := preparePrm(&prm); err != nil {
|
||||
return nil, fmt.Errorf("could not prepare put parameters: %w", err)
|
||||
}
|
||||
|
||||
if prm.Header.Signature() != nil {
|
||||
return newUntrustedTarget(prm)
|
||||
return newUntrustedTarget(&prm)
|
||||
}
|
||||
return newTrustedTarget(prm)
|
||||
return newTrustedTarget(&prm)
|
||||
}
|
||||
|
||||
func newUntrustedTarget(prm *objectwriter.Params) (transformer.ChunkedObjectWriter, error) {
|
||||
|
@ -49,6 +49,7 @@ func newUntrustedTarget(prm *objectwriter.Params) (transformer.ChunkedObjectWrit
|
|||
}
|
||||
|
||||
func newTrustedTarget(prm *objectwriter.Params) (transformer.ChunkedObjectWriter, error) {
|
||||
prm.Relay = nil // do not relay request without signature
|
||||
maxPayloadSz := prm.Config.MaxSizeSrc.MaxObjectSize()
|
||||
if maxPayloadSz == 0 {
|
||||
return nil, errors.New("could not obtain max object size parameter")
|
||||
|
|
|
@ -112,7 +112,7 @@ func (s *Streamer) init(ctx context.Context, req *objectV2.PatchRequest) error {
|
|||
}
|
||||
oV2.GetHeader().SetOwnerID(ownerID)
|
||||
|
||||
target, err := target.New(&objectwriter.Params{
|
||||
target, err := target.New(objectwriter.Params{
|
||||
Config: s.Config,
|
||||
Common: commonPrm,
|
||||
Header: objectSDK.NewFromV2(oV2),
|
||||
|
|
|
@ -26,7 +26,7 @@ func (p *Streamer) Init(ctx context.Context, prm *PutInitPrm) error {
|
|||
}
|
||||
|
||||
// initialize destination target
|
||||
prmTarget := &objectwriter.Params{
|
||||
prmTarget := objectwriter.Params{
|
||||
Config: p.Config,
|
||||
Common: prm.common,
|
||||
Header: prm.hdr,
|
||||
|
|
Loading…
Reference in a new issue