Skip to content

Commit

Permalink
Do not allow infinite for connect-timeout config file parameter.
Browse files Browse the repository at this point in the history
Signed-off-by: Tero Saarni <tero.saarni@est.tech>
  • Loading branch information
tsaarni committed Feb 8, 2022
1 parent 22ddb70 commit 72df8b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/config/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,8 @@ func (t TimeoutParameters) Validate() error {
return fmt.Errorf("connection shutdown grace period %q: %w", t.ConnectionShutdownGracePeriod, err)
}

if err := v(t.ConnectTimeout); err != nil {
// ConnectTimeout cannot be "infinite" so use time.ParseDuration() directly.
if _, err := time.ParseDuration(t.ConnectTimeout); err != nil {
return fmt.Errorf("connect timeout %q: %w", t.ConnectTimeout, err)
}

Expand Down

0 comments on commit 72df8b4

Please sign in to comment.