Introduce Duration so that marshalling works for duration strings

This commit is contained in:
Joel Speed
2020-11-11 23:03:48 +00:00
parent 6254ed24ea
commit de09aed7a5
8 changed files with 49 additions and 18 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ func validateStaticUpstream(upstream options.Upstream) []string {
if upstream.InsecureSkipTLSVerify {
msgs = append(msgs, fmt.Sprintf("upstream %q has insecureSkipTLSVerify, but is a static upstream, this will have no effect.", upstream.ID))
}
if upstream.FlushInterval != nil && *upstream.FlushInterval != time.Second {
if upstream.FlushInterval != nil && upstream.FlushInterval.Duration() != time.Second {
msgs = append(msgs, fmt.Sprintf("upstream %q has flushInterval, but is a static upstream, this will have no effect.", upstream.ID))
}
if upstream.PassHostHeader != nil {
+1 -1
View File
@@ -15,7 +15,7 @@ var _ = Describe("Upstreams", func() {
errStrings []string
}
flushInterval := 5 * time.Second
flushInterval := options.Duration(5 * time.Second)
staticCode200 := 200
truth := true