Validate deployment

This commit is contained in:
nikhiljindal
2015-08-25 12:07:03 -07:00
parent 2321d9ee26
commit 92f373a4b6
9 changed files with 375 additions and 139 deletions

View File

@@ -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)
}