Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
only check swim overrides when we're overriding
Browse files Browse the repository at this point in the history
  • Loading branch information
Dieterbe committed Dec 13, 2017
1 parent ef90f82 commit b49c5e8
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions cluster/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,19 @@ func ConfigSetup() {
}

func ConfigProcess() {

// check settings in cluster section
if !validMode(mode) {
log.Fatal(4, "CLU Config: invalid cluster operating mode")
}

Mode = ModeType(mode)

// all further stuff is only relevant in multi mode
if mode != ModeMulti {
return
}

var err error
swimBindAddr, err = net.ResolveTCPAddr("tcp", swimBindAddrStr)
if err != nil {
log.Fatal(4, "CLU Config: swim-bind-addr is not a valid TCP address: %s", err.Error())
}

if httpTimeout == 0 {
log.Fatal(4, "CLU Config: http-timeout must be a non-zero duration string like 60s")
}
Expand All @@ -110,7 +107,16 @@ func ConfigProcess() {
Timeout: httpTimeout,
}

// check settings in swim section
if swimUseConfig != "manual" && swimUseConfig != "default-lan" && swimUseConfig != "default-local" && swimUseConfig != "default-wan" {
log.Fatal(4, "CLU Config: invalid swim-use-config setting")
}

if swimUseConfig == "manual" {
var err error
swimBindAddr, err = net.ResolveTCPAddr("tcp", swimBindAddrStr)
if err != nil {
log.Fatal(4, "CLU Config: swim-bind-addr is not a valid TCP address: %s", err.Error())
}
}
}

0 comments on commit b49c5e8

Please sign in to comment.