Skip to content

Commit

Permalink
(maint) Docker dig names prior to running host
Browse files Browse the repository at this point in the history
 - Unexpectedly, a Travis failure was also encountered where 30 seconds
   of running `host postgres.internal` failed, but the immediately
   subsequent call to `dig postgres.internal` succeeded.

   Running dig seems to prime a local cache, so perform a dig prior
   to host in an effort to help fix this problem, given the PDB
   container is based on Alpine

   microsoft/opengcs#303
  • Loading branch information
Iristyle committed Oct 28, 2019
1 parent e99fc05 commit 0c849e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docker/puppetdb/docker-entrypoint.d/20-wait-for-hosts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ error() {
wait_for_host_name_resolution() {
# host and dig are in the bind-tools Alpine package
# k8s nodes may not be reachable with a ping
/wtfc.sh --timeout=$PUPPETDB_WAITFORHOST_SECONDS --interval=1 --progress host $1
# performing a dig prior to a host may help prime the cache in Alpine
# https://github.com/Microsoft/opengcs/issues/303
/wtfc.sh --timeout=$PUPPETDB_WAITFORHOST_SECONDS --interval=1 --progress "dig $1 && host $1"
# additionally log the DNS lookup information for diagnostic purposes
NAME_RESOLVED=$?
dig $1
Expand Down

0 comments on commit 0c849e3

Please sign in to comment.