-
Notifications
You must be signed in to change notification settings - Fork 239
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
Add support to detect 5 parts s3 virtual hosted-style requests #314
Conversation
e571d6d
to
e704f62
Compare
This PR allows Nomad to download S3 artifacts using the AWS recommended 5 part virtual-host pattern. Looking for a repo maintainer to review/merge. |
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.
LGTM but I'm going to try to pull in a maintainer for final approval.
@@ -59,3 +61,13 @@ func (d *S3Detector) detectVhostStyle(region, bucket string, parts []string) (st | |||
|
|||
return "s3::" + url.String(), true, nil | |||
} | |||
|
|||
func (d *S3Detector) detectNewVhostStyle(region, bucket string, parts []string) (string, bool, error) { |
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.
NIT: I wonder what the new, new name will be if AWS adds a new 6 parts vhost-style url
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.
Nice one LGTM !
looking at aws doc
https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html#virtual-hosted-style-access
the new s3 virtual hosted-style has 5 hostParts
https://bucket-name.s3.Region.amazonaws.com/key-name
this PR is to enhance the S3Detector, so it recognize this new s3 style.