Sync over some stuff

This commit is contained in:
Jeff Mitchell
2018-08-24 12:09:03 -04:00
parent 0a6e4830bf
commit 935815d3da
12 changed files with 45 additions and 7 deletions

View File

@@ -62,6 +62,9 @@ type Config struct {
DisableClustering bool `hcl:"-"`
DisableClusteringRaw interface{} `hcl:"disable_clustering"`
DisablePerformanceStandby bool `hcl:"-"`
DisablePerformanceStandbyRaw interface{} `hcl:"disable_performance_standby"`
DisableSealWrap bool `hcl:"-"`
DisableSealWrapRaw interface{} `hcl:"disable_sealwrap"`
}
@@ -326,6 +329,11 @@ func (c *Config) Merge(c2 *Config) *Config {
result.PidFile = c2.PidFile
}
result.DisablePerformanceStandby = c.DisablePerformanceStandby
if c2.DisablePerformanceStandby {
result.DisablePerformanceStandby = c2.DisablePerformanceStandby
}
result.DisableSealWrap = c.DisableSealWrap
if c2.DisableSealWrap {
result.DisableSealWrap = c2.DisableSealWrap
@@ -424,6 +432,12 @@ func ParseConfig(d string, logger log.Logger) (*Config, error) {
}
}
if result.DisablePerformanceStandbyRaw != nil {
if result.DisablePerformanceStandby, err = parseutil.ParseBool(result.DisablePerformanceStandbyRaw); err != nil {
return nil, err
}
}
if result.DisableSealWrapRaw != nil {
if result.DisableSealWrap, err = parseutil.ParseBool(result.DisableSealWrapRaw); err != nil {
return nil, err

View File

@@ -67,6 +67,9 @@ func TestLoadConfigFile(t *testing.T) {
EnableRawEndpoint: true,
EnableRawEndpointRaw: true,
DisableSealWrap: true,
DisableSealWrapRaw: true,
MaxLeaseTTL: 10 * time.Hour,
MaxLeaseTTLRaw: "10h",
DefaultLeaseTTL: 10 * time.Hour,
@@ -135,6 +138,9 @@ func TestLoadConfigFile_topLevel(t *testing.T) {
EnableRawEndpoint: true,
EnableRawEndpointRaw: true,
DisableSealWrap: true,
DisableSealWrapRaw: true,
MaxLeaseTTL: 10 * time.Hour,
MaxLeaseTTLRaw: "10h",
DefaultLeaseTTL: 10 * time.Hour,
@@ -210,6 +216,8 @@ func TestLoadConfigFile_json(t *testing.T) {
PidFile: "./pidfile",
EnableRawEndpoint: true,
EnableRawEndpointRaw: true,
DisableSealWrap: true,
DisableSealWrapRaw: true,
}
if !reflect.DeepEqual(config, expected) {
t.Fatalf("expected \n\n%#v\n\n to be \n\n%#v\n\n", config, expected)
@@ -261,6 +269,8 @@ func TestLoadConfigFile_json2(t *testing.T) {
EnableRawEndpoint: true,
DisableSealWrap: true,
Telemetry: &Telemetry{
StatsiteAddr: "foo",
StatsdAddr: "bar",

View File

@@ -30,4 +30,5 @@ default_lease_ttl = "10h"
cluster_name = "testcluster"
pid_file = "./pidfile"
raw_storage_endpoint = true
disable_sealwrap = true
disable_printable_check = true

View File

@@ -19,5 +19,6 @@
"cluster_name":"testcluster",
"ui":true,
"pid_file":"./pidfile",
"raw_storage_endpoint":true
"raw_storage_endpoint":true,
"disable_sealwrap":true
}

View File

@@ -33,3 +33,4 @@ default_lease_ttl = "10h"
cluster_name = "testcluster"
pid_file = "./pidfile"
raw_storage_endpoint = true
disable_sealwrap = true

View File

@@ -1,6 +1,7 @@
{
"ui":true,
"raw_storage_endpoint":true,
"disable_sealwrap":true,
"listener":[
{
"tcp":{