New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rgw: fixes for virtual hosting of buckets #11280
Conversation
cd350bd
to
632c603
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment about the other set variable for staticsites hostnames below.
Also, maybe I'm not seeing it, but we don't actually enforce that any of the entries from the zonegroup hostnames are non-empty; they just seem to be copied from the zonegroup to the set variables.
if (subdomain.empty() | ||
&& (domain.empty() || domain != info.host) | ||
&& !looks_like_ip_address(info.host.c_str()) | ||
&& RGWHandler_REST::validate_bucket_name(info.host)) { | ||
&& RGWHandler_REST::validate_bucket_name(info.host) == 0 | ||
&& !hostnames_set.empty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should check hostnames_s3website_set as well. If either of them are non-empty, it should be ok (should be very rare, but want to check anyway).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
The logic (added in 46aae19) for falling back to just using the hostname as the possible bucket name contained an accidental inversion, because RGWHandler_REST::validate_bucket_name returns success as zero. Backport: jewel Fixes: http://tracker.ceph.com/issues/17136 Re-Fixes: http://tracker.ceph.com/issues/15975 Signed-off-by: Robin H. Johnson <robin.johnson@dreamhost.com>
if no hostnames are configured, all requests were treated as virtual hosted buckets. require at least one hostname in hostnames_set to consider setting in_hosted_domain Fixes: http://tracker.ceph.com/issues/17440 Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Signed-off-by: Casey Bodley <cbodley@redhat.com>
std::accumulate() was appending hostnames without commas or spaces Signed-off-by: Casey Bodley <cbodley@redhat.com>
I ran into one related impact from this, that should be clarified & documented. Thus, in some cases, we know get a lot more false-positive s3-tests breakage.
AWS-S3 treats this as bucket {{non-existing-ceph-buckettest.example.com}}, and returns:
RGW, prior to my patching, treats this as bucket {{foobar}}, and returns:
RGW, with patch, now matches AWS-S3:
|
oops, i was cleaning up branches and nuked this one. reopened |
lgtm. |
jenkins test this please |
new run (previous runs had enviorment problems): http://pulpito.ceph.com/owasserm-2016-10-31_18:27:38-rgw-wip-orit-17440---basic-mira/ |
thanks @oritwas ! |
this brings back the fix from @robbat2 that was reverted in #10873, with an additional check that disables the virtual hosting feature if no hostnames were configured. this prevents default configurations (such as teuthology) from treating all requests as virtual hosted buckets
also updated the docs - a preview should eventually be available at http://docs.ceph.com/docs/wip-17440/radosgw/s3/commons/