mirror of
https://github.com/status-im/consul.git
synced 2025-02-08 20:05:09 +00:00
Fix comments, and remove redundant TestConfig init from a couple of unit tests
This commit is contained in:
parent
b19b062194
commit
840749db7e
@ -2164,7 +2164,7 @@ func (c *Config) ResolveTmplAddrs() (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Additional post processing of the configs to set tagged and advertise addresses
|
// SetupTaggedAndAdvertiseAddrs configures advertise addresses and sets up a map of tagged addresses
|
||||||
func (cfg *Config) SetupTaggedAndAdvertiseAddrs() error {
|
func (cfg *Config) SetupTaggedAndAdvertiseAddrs() error {
|
||||||
if cfg.AdvertiseAddr == "" {
|
if cfg.AdvertiseAddr == "" {
|
||||||
switch {
|
switch {
|
||||||
|
@ -14,8 +14,7 @@ import (
|
|||||||
|
|
||||||
func TestAgentAntiEntropy_Services(t *testing.T) {
|
func TestAgentAntiEntropy_Services(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
cfg := TestConfig()
|
a := &TestAgent{Name: t.Name(), NoInitialSync: true}
|
||||||
a := &TestAgent{Name: t.Name(), NoInitialSync: true, Config: cfg}
|
|
||||||
|
|
||||||
a.Start()
|
a.Start()
|
||||||
defer a.Shutdown()
|
defer a.Shutdown()
|
||||||
@ -672,8 +671,7 @@ func TestAgentAntiEntropy_Services_ACLDeny(t *testing.T) {
|
|||||||
|
|
||||||
func TestAgentAntiEntropy_Checks(t *testing.T) {
|
func TestAgentAntiEntropy_Checks(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
cfg := TestConfig()
|
a := &TestAgent{Name: t.Name(), NoInitialSync: true}
|
||||||
a := &TestAgent{Name: t.Name(), NoInitialSync: true, Config: cfg}
|
|
||||||
a.Start()
|
a.Start()
|
||||||
|
|
||||||
defer a.Shutdown()
|
defer a.Shutdown()
|
||||||
|
@ -466,12 +466,11 @@ func (cmd *AgentCommand) readConfig() *agent.Config {
|
|||||||
cmd.UI.Error(fmt.Sprintf("Failed to parse config: %v", err))
|
cmd.UI.Error(fmt.Sprintf("Failed to parse config: %v", err))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// More post processing of the config
|
|
||||||
if err := cfg.SetupTaggedAndAdvertiseAddrs(); err != nil {
|
if err := cfg.SetupTaggedAndAdvertiseAddrs(); err != nil {
|
||||||
cmd.UI.Error(fmt.Sprintf("Failed to set up tagged and advertise addresses: %v", err))
|
cmd.UI.Error(fmt.Sprintf("Failed to set up tagged and advertise addresses: %v", err))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
// Try to get an advertise address if not set
|
|
||||||
|
|
||||||
return cfg
|
return cfg
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user