forked from TrueCloudLab/frostfs-s3-gw
[#537] Upgrade NeoFS SDK Go with changed netmap
package
`PlacementPolicy` type now provides methods to work with QL-encoded policies. System network parameters can be read using dedicated method without iterating. Applications can work with `PlacementPolicy` variables directly so there is no need to use pointers. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
cfe7591cf7
commit
f0749fd23e
10 changed files with 43 additions and 76 deletions
|
@ -623,16 +623,18 @@ func (h *handler) CreateBucketHandler(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
useDefaultPolicy := true
|
||||
if createParams.LocationConstraint != "" {
|
||||
for _, placementPolicy := range policies {
|
||||
if placementPolicy.LocationConstraint == createParams.LocationConstraint {
|
||||
p.Policy = placementPolicy.Policy
|
||||
p.LocationConstraint = createParams.LocationConstraint
|
||||
useDefaultPolicy = false
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if p.Policy == nil {
|
||||
if useDefaultPolicy {
|
||||
p.Policy = h.cfg.DefaultPolicy
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue