mirror of https://github.com/hashicorp/consul
Style tweaks and vendor.json cleanup
parent
5ddea8a5df
commit
fb68a6bab0
|
@ -564,7 +564,7 @@ func (c *Config) discoverGCEHosts(logger *log.Logger) ([]string, error) {
|
||||||
|
|
||||||
logger.Printf("[INFO] agent: Discovering GCE hosts with tag %s in zones: %s", config.TagValue, strings.Join(zones, ", "))
|
logger.Printf("[INFO] agent: Discovering GCE hosts with tag %s in zones: %s", config.TagValue, strings.Join(zones, ", "))
|
||||||
|
|
||||||
servers := []string{}
|
var servers []string
|
||||||
for _, zone := range zones {
|
for _, zone := range zones {
|
||||||
addresses, err := gceInstancesAddressesForZone(logger, ctx, computeService, config.ProjectName, zone, config.TagValue)
|
addresses, err := gceInstancesAddressesForZone(logger, ctx, computeService, config.ProjectName, zone, config.TagValue)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -611,7 +611,7 @@ func gceProjectIDFromMetadata(logger *log.Logger) (string, error) {
|
||||||
// gceDiscoverZones discovers a list of zones from a supplied zone pattern, or
|
// gceDiscoverZones discovers a list of zones from a supplied zone pattern, or
|
||||||
// all of the zones available to a project.
|
// all of the zones available to a project.
|
||||||
func gceDiscoverZones(logger *log.Logger, ctx context.Context, computeService *compute.Service, project, pattern string) ([]string, error) {
|
func gceDiscoverZones(logger *log.Logger, ctx context.Context, computeService *compute.Service, project, pattern string) ([]string, error) {
|
||||||
zones := []string{}
|
var zones []string
|
||||||
|
|
||||||
if pattern != "" {
|
if pattern != "" {
|
||||||
logger.Printf("[INFO] agent: Discovering zones for project %s matching pattern: %s", project, pattern)
|
logger.Printf("[INFO] agent: Discovering zones for project %s matching pattern: %s", project, pattern)
|
||||||
|
@ -641,7 +641,7 @@ func gceDiscoverZones(logger *log.Logger, ctx context.Context, computeService *c
|
||||||
// and zone, matching the supplied tag. Only the private IP addresses are
|
// and zone, matching the supplied tag. Only the private IP addresses are
|
||||||
// returned, but ID is also logged.
|
// returned, but ID is also logged.
|
||||||
func gceInstancesAddressesForZone(logger *log.Logger, ctx context.Context, computeService *compute.Service, project, zone, tag string) ([]string, error) {
|
func gceInstancesAddressesForZone(logger *log.Logger, ctx context.Context, computeService *compute.Service, project, zone, tag string) ([]string, error) {
|
||||||
addresses := []string{}
|
var addresses []string
|
||||||
call := computeService.Instances.List(project, zone)
|
call := computeService.Instances.List(project, zone)
|
||||||
if err := call.Pages(ctx, func(page *compute.InstanceList) error {
|
if err := call.Pages(ctx, func(page *compute.InstanceList) error {
|
||||||
for _, v := range page.Items {
|
for _, v := range page.Items {
|
||||||
|
@ -842,13 +842,13 @@ func (c *Command) retryJoin(config *Config, errCh chan<- struct{}) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Printf("[ERROR] agent: Unable to query EC2 instances: %s", err)
|
logger.Printf("[ERROR] agent: Unable to query EC2 instances: %s", err)
|
||||||
}
|
}
|
||||||
logger.Printf("[INFO] agent: Discovered %d servers from EC2...", len(servers))
|
logger.Printf("[INFO] agent: Discovered %d servers from EC2", len(servers))
|
||||||
case config.RetryJoinGCE.TagValue != "":
|
case config.RetryJoinGCE.TagValue != "":
|
||||||
servers, err = config.discoverGCEHosts(logger)
|
servers, err = config.discoverGCEHosts(logger)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Printf("[ERROR] agent: Unable to query GCE insances: %s", err)
|
logger.Printf("[ERROR] agent: Unable to query GCE insances: %s", err)
|
||||||
}
|
}
|
||||||
logger.Printf("[INFO] agent: Discovered %d servers from GCE.", len(servers))
|
logger.Printf("[INFO] agent: Discovered %d servers from GCE", len(servers))
|
||||||
}
|
}
|
||||||
|
|
||||||
servers = append(servers, config.RetryJoin...)
|
servers = append(servers, config.RetryJoin...)
|
||||||
|
|
|
@ -2,18 +2,6 @@
|
||||||
"comment": "",
|
"comment": "",
|
||||||
"ignore": "test",
|
"ignore": "test",
|
||||||
"package": [
|
"package": [
|
||||||
{
|
|
||||||
"path": "appengine",
|
|
||||||
"revision": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "appengine_internal",
|
|
||||||
"revision": ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "appengine_internal/base",
|
|
||||||
"revision": ""
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"checksumSHA1": "ZLRh6zW4/DnVsGpgtt+ZiIaEFKc=",
|
"checksumSHA1": "ZLRh6zW4/DnVsGpgtt+ZiIaEFKc=",
|
||||||
"path": "cloud.google.com/go/compute/metadata",
|
"path": "cloud.google.com/go/compute/metadata",
|
||||||
|
@ -26,10 +14,6 @@
|
||||||
"revision": "bfdc39bde7a3c8dd361ea7fcdb69e7a41a475bb9",
|
"revision": "bfdc39bde7a3c8dd361ea7fcdb69e7a41a475bb9",
|
||||||
"revisionTime": "2016-12-01T15:27:07Z"
|
"revisionTime": "2016-12-01T15:27:07Z"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "git",
|
|
||||||
"revision": ""
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"checksumSHA1": "JhyS/zIicgtrSasHSZ6WtXGWJVk=",
|
"checksumSHA1": "JhyS/zIicgtrSasHSZ6WtXGWJVk=",
|
||||||
"path": "github.com/DataDog/datadog-go/statsd",
|
"path": "github.com/DataDog/datadog-go/statsd",
|
||||||
|
@ -911,10 +895,6 @@
|
||||||
"path": "google.golang.org/grpc/transport",
|
"path": "google.golang.org/grpc/transport",
|
||||||
"revision": "708a7f9f3283aa2d4f6132d287d78683babe55c8",
|
"revision": "708a7f9f3283aa2d4f6132d287d78683babe55c8",
|
||||||
"revisionTime": "2016-12-02T18:43:27Z"
|
"revisionTime": "2016-12-02T18:43:27Z"
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "log",
|
|
||||||
"revision": ""
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"rootPath": "github.com/hashicorp/consul"
|
"rootPath": "github.com/hashicorp/consul"
|
||||||
|
|
Loading…
Reference in New Issue