Skip to content

Commit

Permalink
Merge pull request #551 from thockin/dns-fix-lame-delegation
Browse files Browse the repository at this point in the history
Fix check-zone to use cooked configs
  • Loading branch information
k8s-ci-robot authored Jan 28, 2020
2 parents 1a5bc1f + 51ed690 commit 9be75de
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
24 changes: 19 additions & 5 deletions dns/check-zone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,22 @@

read -r -d '' USAGE <<- EOF
Usage:
$0 example.com.\t\t\t# Check a single zone
$0 example.com. example.io.\t# Check a multiple zones
$0 -c confdir example.com.\t\t# Check a single zone
$0 -c confdir example.com. example.io.\t# Check a multiple zones
EOF

while getopts ":h" opt; do
while getopts ":hc:" opt; do
case ${opt} in
c )
TMPCFG="${OPTARG}"
;;
h )
echo -e "${USAGE}"
exit 0
;;
\? )
echo -e "Invalid option.\n" >&2
echo -e "${USAGE}"
echo -e "${USAGE}" >&2
exit 1
;;
esac
Expand All @@ -42,12 +45,23 @@ shift $((OPTIND -1))

DOMAINS=("$@")

if [ -z "${TMPCFG}" ]; then
echo -e "confdir must be specified" >&2
echo -e "${USAGE}" >&2
exit 2
fi
if [ ! -d "${TMPCFG}" ]; then
echo -e "confdir must exist" >&2
echo -e "${USAGE}" >&2
exit 2
fi

echo "Checking that the GCP dns servers for (${DOMAINS[@]}) serve up everything in our octodns config"
docker run -ti \
-u `id -u` \
-v ~/.config/gcloud:/.config/gcloud:ro \
-v `pwd`/octodns-config.yaml:/octodns/config.yaml:ro \
-v `pwd`/zone-configs:/octodns/config:ro \
-v "${TMPCFG}":/octodns/config:ro \
${USER}/octodns \
check-zone \
--config-file=/octodns/config.yaml \
Expand Down
4 changes: 2 additions & 2 deletions dns/push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ for zone in "${CANARY_ZONES[@]}"; do
TRIES=12
echo "Testing canary zone: $zone"
for i in $(seq 1 "$TRIES"); do
./check-zone.sh "$zone" >> log.canary 2>&1
./check-zone.sh -c "${TMPCFG}" "$zone" >> log.canary 2>&1
if [ $? == 0 ]; then
break
fi
Expand Down Expand Up @@ -133,7 +133,7 @@ for zone in "${PROD_ZONES[@]}"; do
TRIES=12
echo "Testing prod zone: $zone"
for i in $(seq 1 "$TRIES"); do
./check-zone.sh "$zone" >> log.prod 2>&1
./check-zone.sh -c "${TMPCFG}" "$zone" >> log.prod 2>&1
if [ $? == 0 ]; then
break
fi
Expand Down

0 comments on commit 9be75de

Please sign in to comment.