Skip to content
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

Merged
merged 1 commit into from
Apr 29, 2021

Conversation

ericdong66
Copy link
Contributor

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.

@hashicorp-cla
Copy link

hashicorp-cla commented Mar 29, 2021

CLA assistant check
All committers have signed the CLA.

@davemay99
Copy link

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.

Copy link
Member

@tgross tgross left a 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) {
Copy link
Contributor

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

Copy link
Contributor

@azr azr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one LGTM !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants