mirror of https://github.com/goharbor/harbor.git
Update isValidDuration function (#19843)
Signed-off-by: Yang Jiao <yang.jiao@broadcom.com>
This commit is contained in:
parent
7e0f6cc501
commit
308c6cf657
|
@ -374,7 +374,7 @@ func isValidLevel(l string) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func isValidDuration(d int64) 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
|
// validateName validates the robot name, especially '+' cannot be a valid character
|
||||||
|
|
Loading…
Reference in New Issue