Skip to content

Commit

Permalink
config: ignore refresh for consul cert source
Browse files Browse the repository at this point in the history
consul cert sources are using a blocking call and ignore the
refresh time.
  • Loading branch information
magiconair committed Jun 13, 2017
1 parent b6efae3 commit b6ac346
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ func parseCertSource(cfg map[string]string) (c CertSource, err error) {
if c.Type != "file" && c.Type != "path" && c.Type != "http" && c.Type != "consul" && c.Type != "vault" {
return CertSource{}, fmt.Errorf("unknown cert source type %s", c.Type)
}
if c.Type == "file" {
if c.Type == "file" || c.Type == "consul" {
c.Refresh = 0
}
return
Expand Down
2 changes: 1 addition & 1 deletion config/load_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func TestLoad(t *testing.T) {
args: []string{"-proxy.addr", ":5555;cs=name", "-proxy.cs", "cs=name;type=consul;cert=value"},
cfg: func(cfg *Config) *Config {
cfg.Listen = []Listen{Listen{Addr: ":5555", Proto: "https"}}
cfg.Listen[0].CertSource = CertSource{Name: "name", Type: "consul", CertPath: "value", Refresh: 3 * time.Second}
cfg.Listen[0].CertSource = CertSource{Name: "name", Type: "consul", CertPath: "value"}
return cfg
},
},
Expand Down

0 comments on commit b6ac346

Please sign in to comment.