mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-12-12 02:55:34 +00:00
Validate deployment
This commit is contained in:
@@ -139,3 +139,11 @@ func IsValidPortName(port string) bool {
|
||||
func IsValidIPv4(value string) bool {
|
||||
return net.ParseIP(value) != nil && net.ParseIP(value).To4() != nil
|
||||
}
|
||||
|
||||
const percentFmt string = "[0-9]+%"
|
||||
|
||||
var percentRegexp = regexp.MustCompile("^" + percentFmt + "$")
|
||||
|
||||
func IsValidPercent(percent string) bool {
|
||||
return percentRegexp.MatchString(percent)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user