mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 02:15:43 +03:00
Fixed a bunch of TLS related failures
This commit is contained in:
@@ -4,8 +4,6 @@ import (
|
||||
"fmt"
|
||||
"sort"
|
||||
"strconv"
|
||||
|
||||
"github.com/hashicorp/go-cleanhttp"
|
||||
)
|
||||
|
||||
// Nodes is used to query node-related API endpoints
|
||||
@@ -82,10 +80,7 @@ func (n *Nodes) Stats(nodeID string, q *QueryOptions) (*HostStats, error) {
|
||||
if node.HTTPAddr == "" {
|
||||
return nil, fmt.Errorf("http addr of the node %q is running is not advertised", nodeID)
|
||||
}
|
||||
client, err := NewClient(&Config{
|
||||
Address: fmt.Sprintf("http://%s", node.HTTPAddr),
|
||||
HttpClient: cleanhttp.DefaultClient(),
|
||||
})
|
||||
client, err := NewClient(n.client.config.CopyConfig(node.HTTPAddr, node.TLSEnabled))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -158,6 +158,7 @@ func DefaultConfig() *Config {
|
||||
LogOutput: os.Stderr,
|
||||
Region: "global",
|
||||
StatsCollectionInterval: 1 * time.Second,
|
||||
TLSConfig: &config.TLSConfig{},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ func TestConfig_Parse(t *testing.T) {
|
||||
TaskTokenTTL: "1s",
|
||||
Token: "12345",
|
||||
},
|
||||
TLSConfig: &TLSConfig{
|
||||
TLSConfig: &config.TLSConfig{
|
||||
EnableHTTP: true,
|
||||
EnableRPC: true,
|
||||
VerifyServerHostname: true,
|
||||
|
||||
@@ -16,7 +16,6 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/nomad/client/allocdir"
|
||||
"github.com/hashicorp/nomad/nomad/structs"
|
||||
"github.com/hashicorp/nomad/testutil"
|
||||
"github.com/ugorji/go/codec"
|
||||
)
|
||||
|
||||
@@ -18,7 +18,18 @@ func TestMeta_FlagSet(t *testing.T) {
|
||||
},
|
||||
{
|
||||
FlagSetClient,
|
||||
[]string{"address", "no-color", "region"},
|
||||
[]string{
|
||||
"address",
|
||||
"no-color",
|
||||
"region",
|
||||
"address",
|
||||
"ca-cert",
|
||||
"ca-path",
|
||||
"client-cert",
|
||||
"client-key",
|
||||
"insecure",
|
||||
"tls-skip-verify",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -243,6 +243,7 @@ func DefaultConfig() *Config {
|
||||
ConsulConfig: config.DefaultConsulConfig(),
|
||||
VaultConfig: config.DefaultVaultConfig(),
|
||||
RPCHoldTimeout: 5 * time.Second,
|
||||
TLSConfig: &config.TLSConfig{},
|
||||
}
|
||||
|
||||
// Enable all known schedulers by default
|
||||
|
||||
Reference in New Issue
Block a user