Update isValidDuration function (#19843)

Signed-off-by: Yang Jiao <yang.jiao@broadcom.com>
This commit is contained in:
Yang Jiao 2024-01-17 16:41:45 +08:00 committed by GitHub
parent 7e0f6cc501
commit 308c6cf657
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -374,7 +374,7 @@ func isValidLevel(l string) bool {
}
func isValidDuration(d int64) bool {
return d >= int64(-1) && d != 0 && d < math.MaxInt32
return d == -1 || (d > 0 && d < math.MaxInt32)
}
// validateName validates the robot name, especially '+' cannot be a valid character