Add a metadata provider for Vultr

Vultr uses a very similar approach to AWS, including using the
same IP address for serving metadata. In fact, it seems
as though if AWS appears first in the list of providers, that
provider mistakenly believes to be running on AWS (hence the
insertion of `NewVultr` in between GCP and AWS. I don't believe
AWS servers will accidentally try to use the Vultr provider,
as it seems that the `/v1/` endpoint doesn't exist on AWS.

Signed-off-by: Luke Hodkinson <furious.luke@gmail.com>
This commit is contained in:
Luke Hodkinson
2017-06-21 20:14:58 +10:00
parent 8be67983ff
commit 3dc23b96ac
2 changed files with 124 additions and 1 deletions

View File

@@ -47,7 +47,7 @@ var netProviders []Provider
var cdromProviders []Provider
func init() {
netProviders = []Provider{NewGCP(), NewAWS()}
netProviders = []Provider{NewGCP(), NewVultr(), NewAWS()}
cdromProviders = []Provider{NewCDROM()}
}