mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 08:47:35 +08:00
adding ipv6 details. Need to test now
This commit is contained in:
@@ -465,8 +465,8 @@ func ValidateDNSCreate(entry models.DNSEntry) error {
|
||||
|
||||
_ = v.RegisterValidation("address_valid", func(fl validator.FieldLevel) bool {
|
||||
notEmptyCheck := len(entry.Address) > 0
|
||||
isIpv4 := functions.IsIpv4Net(entry.Address)
|
||||
return notEmptyCheck && isIpv4
|
||||
isIp := functions.IsIpNet(entry.Address)
|
||||
return notEmptyCheck && isIp
|
||||
})
|
||||
_ = v.RegisterValidation("network_exists", func(fl validator.FieldLevel) bool {
|
||||
_, err := functions.GetParentNetwork(entry.Network)
|
||||
@@ -507,7 +507,7 @@ func ValidateDNSUpdate(change models.DNSEntry, entry models.DNSEntry) error {
|
||||
_ = v.RegisterValidation("address_valid", func(fl validator.FieldLevel) bool {
|
||||
isValid := true
|
||||
if entry.Address != "" {
|
||||
isValid = functions.IsIpv4Net(entry.Address)
|
||||
isValid = functions.IsIpNet(entry.Address)
|
||||
}
|
||||
return isValid
|
||||
})
|
||||
|
Reference in New Issue
Block a user