When trying to set a policy on the bucket, fail unless policy matches
current placement rule.
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
if (ret < 0)
return;
+ if (!s->object && !placement_rule.empty()) {
+ if (placement_rule != s->bucket_info.placement_rule) {
+ ret = -EEXIST;
+ return;
+ }
+ }
+
/* only remove meta attrs */
for (iter = orig_attrs.begin(); iter != orig_attrs.end(); ++iter) {
const string& name = iter->first;
bool has_policy, has_cors;
RGWAccessControlPolicy policy;
RGWCORSConfiguration cors_config;
+ string placement_rule;
public:
RGWPutMetadata() {
return r;
}
}
+ placement_rule = s->info.env->get("HTTP_X_STORAGE_POLICY", "");
return 0;
}