From 9f4030cdb6e90cc7597d87876a929d20cd403426 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Sat, 13 May 2017 14:34:29 +0100 Subject: [PATCH] Move AWSVPC/IPAM check to Go code The weave script check was broken in an earlier commit. The Go error message is less specific because it checks more cases. --- prog/weaver/main.go | 3 +++ weave | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/prog/weaver/main.go b/prog/weaver/main.go index 3154266d..8217d730 100644 --- a/prog/weaver/main.go +++ b/prog/weaver/main.go @@ -316,6 +316,9 @@ func main() { if bridgeConfig.AWSVPC && len(config.Password) > 0 { Log.Fatalf("--awsvpc mode is not compatible with the --password option") } + if bridgeConfig.AWSVPC && !ipamConfig.Enabled() { + Log.Fatalf("--awsvpc mode requires IPAM enabled") + } db, err := db.NewBoltDB(dbPrefix) checkFatal(err) diff --git a/weave b/weave index 35e4c0e3..f05f1bb3 100755 --- a/weave +++ b/weave @@ -1252,10 +1252,6 @@ launch() { exit 1 fi else - if [ -n "$AWSVPC" -a -z "$IPRANGE" ] ; then - echo "ERROR: Empty --ipalloc-range is not compatible with --awsvpc." >&2 - exit 1 - fi if [ -n "$IPRANGE" ] && ! check_overlap $IPRANGE ; then echo "WARNING: Specified --ipalloc-range $IPRANGE overlaps with existing route on host." >&2 echo "Unless this is deliberate, you must pick another range and set it on all hosts." >&2