use parseutil.ParseDurationSecond(...) which allows a value without a suffix to be treated as seconds instead of nanoseconds (#1447)

pull/1435/head
Jim 5 years ago committed by GitHub
parent acc3dda2df
commit 00cb18efbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -476,7 +476,7 @@ func parseEventing(eventObj *ast.ObjectItem) (*event.EventerConfig, error) {
// parse the duration string specified in a file config into a time.Duration
if s.FileConfig != nil && s.FileConfig.RotateDurationHCL != "" {
var err error
s.FileConfig.RotateDuration, err = time.ParseDuration(s.FileConfig.RotateDurationHCL)
s.FileConfig.RotateDuration, err = parseutil.ParseDurationSecond(s.FileConfig.RotateDurationHCL)
if err != nil {
return nil, fmt.Errorf("can't parse rotation duration %s", s.FileConfig.RotateDurationHCL)
}

Loading…
Cancel
Save