extract helper for obtaining container ip address

thus keeping the ghastly regexp in one place instead of three.
This commit is contained in:
Matthias Radestock committed 2015-05-16 19:14:23 +01:00
1 parent bb8a745431
commit 2647fd4c92
4 files changed
+7 -3

No files matched your search

+4
View File
@@ -88,6 +88,10 @@ exec_on() {
docker -H tcp://$host:2375 exec $container $@
}
container_ip() {
weave_on $1 ps $2 | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'
}
# assert_dns_record <host> <container> <name> <ip>
assert_dns_record() {
assert "exec_on $1 $2 getent hosts $3 | tr -s ' '" "$4 $3"