diff --git a/pkg/deploy/gce/deploy.go b/pkg/deploy/gce/deploy.go index 21a9d1385..65c72a709 100644 --- a/pkg/deploy/gce/deploy.go +++ b/pkg/deploy/gce/deploy.go @@ -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, diff --git a/pkg/serverinit/env.go b/pkg/serverinit/env.go index fb2ba670f..857e3871f 100644 --- a/pkg/serverinit/env.go +++ b/pkg/serverinit/env.go @@ -59,7 +59,7 @@ func DefaultEnvConfig() (*Config, error) { ipOrHost, _ := metadata.ExternalIP() host, _ := metadata.InstanceAttributeValue("camlistore-hostname") - if host != "" { + if host != "" && host != "localhost" { ipOrHost = host }