For GCE, don't send and ignore a 'localhost' hostname.

Change-Id: I329e86783c4b14deb9b8dfcb6ac827e3436d5faa
This commit is contained in:
Brad Fitzpatrick 2015-04-02 03:40:19 -07:00
parent c7213346d0
commit 58ec210183
2 changed files with 2 additions and 2 deletions

View File

@ -384,7 +384,7 @@ func (d *Deployer) createInstance(computeService *compute.Service, ctx *context.
},
},
}
if d.Conf.Hostname != "" {
if d.Conf.Hostname != "" && d.Conf.Hostname != "localhost" {
instance.Metadata.Items = append(instance.Metadata.Items, &compute.MetadataItems{
Key: "camlistore-hostname",
Value: d.Conf.Hostname,

View File

@ -59,7 +59,7 @@ func DefaultEnvConfig() (*Config, error) {
ipOrHost, _ := metadata.ExternalIP()
host, _ := metadata.InstanceAttributeValue("camlistore-hostname")
if host != "" {
if host != "" && host != "localhost" {
ipOrHost = host
}