mirror of
https://github.com/status-im/consul.git
synced 2025-02-26 20:30:39 +00:00
Update make static-assets goal and run format
This commit is contained in:
parent
58da0bc7dc
commit
af4be34a2a
@ -122,7 +122,7 @@ ui:
|
|||||||
# changes to the UI assets that aren't checked in.
|
# changes to the UI assets that aren't checked in.
|
||||||
static-assets:
|
static-assets:
|
||||||
@go-bindata-assetfs -pkg agent -prefix pkg ./pkg/web_ui/...
|
@go-bindata-assetfs -pkg agent -prefix pkg ./pkg/web_ui/...
|
||||||
@mv bindata_assetfs.go agent/
|
@mv bindata.go agent/bindata_assetfs.go
|
||||||
$(MAKE) format
|
$(MAKE) format
|
||||||
|
|
||||||
tools:
|
tools:
|
||||||
|
@ -407,8 +407,8 @@ func (p *PreparedQuery) Execute(args *structs.PreparedQueryExecuteRequest,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
p.srv.logger.Printf("[WARN] Prepared Query using near=_ip requires "+
|
p.srv.logger.Printf("[WARN] Prepared Query using near=_ip requires " +
|
||||||
"the source IP to be set but none was provided. No distance "+
|
"the source IP to be set but none was provided. No distance " +
|
||||||
"sorting will be done.")
|
"sorting will be done.")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -917,7 +917,7 @@ func (d *DNSServer) serviceLookup(network, datacenter, service, tag string, req,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func ednsSubnetForRequest(req *dns.Msg) (*dns.EDNS0_SUBNET) {
|
func ednsSubnetForRequest(req *dns.Msg) *dns.EDNS0_SUBNET {
|
||||||
// IsEdns0 returns the EDNS RR if present or nil otherwise
|
// IsEdns0 returns the EDNS RR if present or nil otherwise
|
||||||
edns := req.IsEdns0()
|
edns := req.IsEdns0()
|
||||||
|
|
||||||
@ -931,7 +931,7 @@ func ednsSubnetForRequest(req *dns.Msg) (*dns.EDNS0_SUBNET) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil;
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// preparedQueryLookup is used to handle a prepared query.
|
// preparedQueryLookup is used to handle a prepared query.
|
||||||
|
@ -9,15 +9,15 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
"github.com/hashicorp/consul/agent/config"
|
"github.com/hashicorp/consul/agent/config"
|
||||||
"github.com/hashicorp/consul/agent/structs"
|
"github.com/hashicorp/consul/agent/structs"
|
||||||
"github.com/hashicorp/consul/api"
|
"github.com/hashicorp/consul/api"
|
||||||
"github.com/hashicorp/consul/lib"
|
"github.com/hashicorp/consul/lib"
|
||||||
"github.com/hashicorp/consul/testutil/retry"
|
"github.com/hashicorp/consul/testutil/retry"
|
||||||
|
"github.com/hashicorp/serf/coordinate"
|
||||||
"github.com/miekg/dns"
|
"github.com/miekg/dns"
|
||||||
"github.com/pascaldekloe/goe/verify"
|
"github.com/pascaldekloe/goe/verify"
|
||||||
"github.com/hashicorp/serf/coordinate"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -1839,14 +1839,14 @@ func TestDNS_ServiceLookup_TagPeriod(t *testing.T) {
|
|||||||
|
|
||||||
func TestDNS_PreparedQueryNearIPEDNS(t *testing.T) {
|
func TestDNS_PreparedQueryNearIPEDNS(t *testing.T) {
|
||||||
ipCoord := lib.GenerateCoordinate(1 * time.Millisecond)
|
ipCoord := lib.GenerateCoordinate(1 * time.Millisecond)
|
||||||
serviceNodes := []struct{
|
serviceNodes := []struct {
|
||||||
name string
|
name string
|
||||||
address string
|
address string
|
||||||
coord *coordinate.Coordinate
|
coord *coordinate.Coordinate
|
||||||
}{
|
}{
|
||||||
{"foo1", "198.18.0.1", lib.GenerateCoordinate(1 * time.Millisecond),},
|
{"foo1", "198.18.0.1", lib.GenerateCoordinate(1 * time.Millisecond)},
|
||||||
{"foo2", "198.18.0.2", lib.GenerateCoordinate(10 * time.Millisecond),},
|
{"foo2", "198.18.0.2", lib.GenerateCoordinate(10 * time.Millisecond)},
|
||||||
{"foo3", "198.18.0.3", lib.GenerateCoordinate(30 * time.Millisecond),},
|
{"foo3", "198.18.0.3", lib.GenerateCoordinate(30 * time.Millisecond)},
|
||||||
}
|
}
|
||||||
|
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
@ -1965,14 +1965,14 @@ func TestDNS_PreparedQueryNearIPEDNS(t *testing.T) {
|
|||||||
|
|
||||||
func TestDNS_PreparedQueryNearIP(t *testing.T) {
|
func TestDNS_PreparedQueryNearIP(t *testing.T) {
|
||||||
ipCoord := lib.GenerateCoordinate(1 * time.Millisecond)
|
ipCoord := lib.GenerateCoordinate(1 * time.Millisecond)
|
||||||
serviceNodes := []struct{
|
serviceNodes := []struct {
|
||||||
name string
|
name string
|
||||||
address string
|
address string
|
||||||
coord *coordinate.Coordinate
|
coord *coordinate.Coordinate
|
||||||
}{
|
}{
|
||||||
{"foo1", "198.18.0.1", lib.GenerateCoordinate(1 * time.Millisecond),},
|
{"foo1", "198.18.0.1", lib.GenerateCoordinate(1 * time.Millisecond)},
|
||||||
{"foo2", "198.18.0.2", lib.GenerateCoordinate(10 * time.Millisecond),},
|
{"foo2", "198.18.0.2", lib.GenerateCoordinate(10 * time.Millisecond)},
|
||||||
{"foo3", "198.18.0.3", lib.GenerateCoordinate(30 * time.Millisecond),},
|
{"foo3", "198.18.0.3", lib.GenerateCoordinate(30 * time.Millisecond)},
|
||||||
}
|
}
|
||||||
|
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
@ -12,12 +12,12 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/NYTimes/gziphandler"
|
||||||
"github.com/armon/go-metrics"
|
"github.com/armon/go-metrics"
|
||||||
"github.com/hashicorp/consul/acl"
|
"github.com/hashicorp/consul/acl"
|
||||||
"github.com/hashicorp/consul/agent/structs"
|
"github.com/hashicorp/consul/agent/structs"
|
||||||
"github.com/hashicorp/go-cleanhttp"
|
"github.com/hashicorp/go-cleanhttp"
|
||||||
"github.com/mitchellh/mapstructure"
|
"github.com/mitchellh/mapstructure"
|
||||||
"github.com/NYTimes/gziphandler"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// MethodNotAllowedError should be returned by a handler when the HTTP method is not allowed.
|
// MethodNotAllowedError should be returned by a handler when the HTTP method is not allowed.
|
||||||
@ -521,7 +521,6 @@ func sourceAddrFromRequest(req *http.Request) string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// parseSource is used to parse the ?near=<node> query parameter, used for
|
// parseSource is used to parse the ?near=<node> query parameter, used for
|
||||||
// sorting by RTT based on a source node. We set the source's DC to the target
|
// sorting by RTT based on a source node. We set the source's DC to the target
|
||||||
// DC in the request, if given, or else the agent's DC.
|
// DC in the request, if given, or else the agent's DC.
|
||||||
|
@ -7,9 +7,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
require "github.com/stretchr/testify/require"
|
|
||||||
"github.com/hashicorp/consul/testutil"
|
"github.com/hashicorp/consul/testutil"
|
||||||
"github.com/mitchellh/cli"
|
"github.com/mitchellh/cli"
|
||||||
|
require "github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestValidateCommand_noTabs(t *testing.T) {
|
func TestValidateCommand_noTabs(t *testing.T) {
|
||||||
@ -72,7 +72,6 @@ func TestValidateCommand_SucceedWithMinimalHCLConfigFormat(t *testing.T) {
|
|||||||
err := ioutil.WriteFile(fp, []byte("bind_addr = \"10.0.0.1\"\ndata_dir = \""+td+"\""), 0644)
|
err := ioutil.WriteFile(fp, []byte("bind_addr = \"10.0.0.1\"\ndata_dir = \""+td+"\""), 0644)
|
||||||
require.Nilf(t, err, "err: %s", err)
|
require.Nilf(t, err, "err: %s", err)
|
||||||
|
|
||||||
|
|
||||||
cmd := New(cli.NewMockUi())
|
cmd := New(cli.NewMockUi())
|
||||||
args := []string{"--config-format", "hcl", fp}
|
args := []string{"--config-format", "hcl", fp}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user