diff --git a/test/200_dns_test.sh b/test/200_dns_test.sh index 7da0de0d..ae110030 100755 --- a/test/200_dns_test.sh +++ b/test/200_dns_test.sh @@ -21,6 +21,13 @@ start_container_with_dns $HOST1 $C1/24 --name=c1 $STATICS_ARGS assert_dns_record $HOST1 c1 $NAME $C2 +# Check that 'weave expose -h' names are added to DNS +weave_on $HOST1 expose +EXPOSE=$(weave_on $HOST1 expose -h testexpose1.weave.local) +weave_on $HOST1 expose -h testexpose2.weave.local +assert_dns_record $HOST1 c1 testexpose1.weave.local $EXPOSE +assert_dns_record $HOST1 c1 testexpose2.weave.local + # check we respect the --add-host arguments for C in c1 c2 ; do assert_dns_a_record $HOST1 $C $STATIC1_NAME $STATIC1 diff --git a/weave b/weave index 3e5de581..2f41549d 100755 --- a/weave +++ b/weave @@ -1896,9 +1896,9 @@ EOF arp_update $BRIDGE $CIDR add_iptables_rule nat WEAVE -d $CIDR ! -s $CIDR -j MASQUERADE add_iptables_rule nat WEAVE -s $CIDR ! -d $CIDR -j MASQUERADE - if [ -n "$FQDN" ] ; then - when_weave_running put_dns_fqdn_no_check_alive weave:expose $FQDN $CIDR - fi + fi + if [ -n "$FQDN" ] ; then + when_weave_running put_dns_fqdn_no_check_alive weave:expose $FQDN $CIDR fi done show_addrs $ALL_CIDRS