summaryrefslogtreecommitdiff
path: root/validate.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-25 15:46:49 -0500
committerJeff Carr <[email protected]>2024-10-25 15:46:49 -0500
commitb6dd67b73df2915d7c042a71ea95120de4c95529 (patch)
treeff9efefea9ae05e702add6e22a679b0948880cfb /validate.go
parent7cc0bd9b2c85c24f71e4c1e471db7e6a1ccecb48 (diff)
fails on imports with duplicate mac addrs
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'validate.go')
-rw-r--r--validate.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/validate.go b/validate.go
index 12370b8..2faaf38 100644
--- a/validate.go
+++ b/validate.go
@@ -21,6 +21,19 @@ import (
"go.wit.com/log"
)
+// will make sure the mac address is unique
+func checkUniqueMac(mac string) bool {
+ for _, d := range me.cluster.Droplets {
+ for _, n := range d.Networks {
+ if n.Mac == mac {
+ log.Info("duplicate MAC", n.Mac, "in droplet", d.Hostname)
+ return false
+ }
+ }
+ }
+ return true
+}
+
func checkDroplets(dump bool) bool {
// uuid map to check for duplicates
var umap map[string]string