[#747] Reload policies on SIGHUP

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-11-14 12:37:47 +03:00 committed by Alex Vanin
parent f5fe9a9b4b
commit d2587b21af
4 changed files with 131 additions and 59 deletions

View file

@ -748,13 +748,13 @@ func (h *handler) CreateBucketHandler(w http.ResponseWriter, r *http.Request) {
}
func (h handler) setPolicy(prm *layer.CreateBucketParams, locationConstraint string, userPolicies []*accessbox.ContainerPolicy) {
prm.Policy = h.cfg.Policy.Default
prm.Policy = h.cfg.Policy.Default()
if locationConstraint == "" {
return
}
if policy, ok := h.cfg.Policy.RegionMap[locationConstraint]; ok {
if policy, ok := h.cfg.Policy.Get(locationConstraint); ok {
prm.Policy = policy
prm.LocationConstraint = locationConstraint
}