Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Static website module impl #2

Merged
merged 11 commits into from
Mar 1, 2019
Merged

Static website module impl #2

merged 11 commits into from
Mar 1, 2019

Conversation

autero1
Copy link
Contributor

@autero1 autero1 commented Feb 28, 2019

This PR adds support for hosting static websites with Google Cloud Storage.

}
}

func lookupIP(t *testing.T, domainName string) (string, error) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a true yak shave... Couldn't figure out another way to resolve it. Could be my own dev machine DNS resolution is broken, but this fixed that issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

@autero1 I found when launching services on my GKE cluster it takes around 5 minutes until the public IPs are resolving. Could this be something similar?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That might well be the case.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm I can't seem to find any reference to DNS caching in Go other than this old post: https://stackoverflow.com/questions/40251727/does-go-cache-dns-lookups, which suggests it is NOT cached. Also, reading the documentation for net, it looks like it just looks it up using the configured DNS servers of your computer.

Is your dev machine DNS set to use google as well? And were you getting the same issue in CircleCI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What was odd, was that while the test locally was failing to resolve, dig gave me the correct results.

@autero1 autero1 requested a review from rileykarson February 28, 2019 11:35
Copy link
Contributor

@robmorgan robmorgan left a comment

Choose a reason for hiding this comment

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

Looking good!

examples/cloud-storage-static-website/main.tf Outdated Show resolved Hide resolved
examples/cloud-storage-static-website/variables.tf Outdated Show resolved Hide resolved
modules/cloud-storage-static-website/main.tf Outdated Show resolved Hide resolved
}
}

func lookupIP(t *testing.T, domainName string) (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@autero1 I found when launching services on my GKE cluster it takes around 5 minutes until the public IPs are resolving. Could this be something similar?

@autero1 autero1 requested a review from robmorgan February 28, 2019 20:00
Copy link
Contributor

@yorinasub17 yorinasub17 left a comment

Choose a reason for hiding this comment

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

LGTM! Suggested fixes for some style nits and typos.

examples/cloud-storage-static-website/main.tf Outdated Show resolved Hide resolved
examples/cloud-storage-static-website/variables.tf Outdated Show resolved Hide resolved
examples/cloud-storage-static-website/variables.tf Outdated Show resolved Hide resolved
test/cloud_storage_static_website_test.go Outdated Show resolved Hide resolved
"net/http"
"strings"
"testing"
"time"
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: See above re imports

}
}

func lookupIP(t *testing.T, domainName string) (string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm I can't seem to find any reference to DNS caching in Go other than this old post: https://stackoverflow.com/questions/40251727/does-go-cache-dns-lookups, which suggests it is NOT cached. Also, reading the documentation for net, it looks like it just looks it up using the configured DNS servers of your computer.

Is your dev machine DNS set to use google as well? And were you getting the same issue in CircleCI?

modules/cloud-storage-static-website/variables.tf Outdated Show resolved Hide resolved
modules/cloud-storage-static-website/variables.tf Outdated Show resolved Hide resolved
@autero1 autero1 merged commit 3b13c0b into master Mar 1, 2019
@autero1 autero1 deleted the static-website branch March 1, 2019 06:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants