Skip to content

Commit

Permalink
Check docker can also resolve hostnames
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisburr committed Apr 9, 2024
1 parent 28cc479 commit b3127f2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion run_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ function check_hostname(){
printf "%b Hostname %s resolves to 127.0.0.1 but this is not supported\n" ${SKULL_EMOJI} "${1}"
return 1
fi
if ! docker_ip_address=$(docker run --rm -it alpine ping -c 1 "$1" | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' | head -n 1); then
printf "%b ping command exited with a non-zero exit code from within docker\n" ${SKULL_EMOJI}
return 1
fi
if [[ "${ip_address}" != "${docker_ip_address}" ]]; then
printf "%b Hostname %s resolves to %s but within docker it resolves to %s\n" ${SKULL_EMOJI} "${1}" "${ip_address}" "${docker_ip_address}"
return 1
fi
}

function element_not_in_array() {
Expand Down Expand Up @@ -452,7 +460,7 @@ else
printf "%b %b %b Pods are ready! %b %b %b\n" "${PARTY_EMOJI}" "${PARTY_EMOJI}" "${PARTY_EMOJI}" "${PARTY_EMOJI}" "${PARTY_EMOJI}" "${PARTY_EMOJI}"

# Dump the CA certificate to a file so that it can be used by the client
"${demo_dir}/kubectl" get secret/root-secret -o template --template='{{.data."tls.crt"}}' | base64 -d > "${demo_dir}/demo-ca.pem"
"${demo_dir}/kubectl" get secret/root-secret -o template --template='{{ index .data "tls.crt" }}' | base64 -d > "${demo_dir}/demo-ca.pem"

printf "%b Creating initial CS content ...\n" ${UNICORN_EMOJI}
"${demo_dir}/kubectl" exec deployments/diracx-demo-cli -- bash /entrypoint.sh dirac internal add-vo /cs_store/initialRepo \
Expand Down

0 comments on commit b3127f2

Please sign in to comment.