Review: Approve +1

LGTM

Alternatively, you could use bind's `include` to include a file with the 
`allow-recursion` rather than patch and unpatch.


Diff comments:

> diff --git a/image-scripts/docker-wrapper.sh b/image-scripts/docker-wrapper.sh
> index 4f807e1..97c4997 100644
> --- a/image-scripts/docker-wrapper.sh
> +++ b/image-scripts/docker-wrapper.sh
> @@ -1,25 +1,34 @@
>  #!/bin/bash
> +
>  set -eu
>  
> +echo "Fresh wrapper run at $(date)";
> +
>  if [ -z "${BIND_CONFDIR-}" ]; then
> -     # If BIND_CONFDIR wasn't set, use the package default
> -     BIND_CONFDIR="/etc/bind";
> +    # If BIND_CONFDIR wasn't set, use the package default
> +    BIND_CONFDIR="/etc/bind";
>  fi
>  
>  if [ -z "${CUSTOM_CONFIG_REPO-}" ]; then
> -     echo "No custom repo set, will fall back to package default config";
> +    echo "No custom repo set, will fall back to package default config";
> +    if [ -z "${ENABLE_RFC1918_RECURSION-}" ]; then
> +        echo "RFC1918 network recursion disabled, using stock config";
> +        apt-get install --reinstall -o 
> Dpkg::Options::="--force-confask,confnew,confmiss" bind9

You probably also want noninteractive here. `DEBIAN_FRONTEND=noninteractive 
apt-get install ...` or in your Dockerfile `ENV DEBIAN_FRONTEND noninteractive` 
if not already..

> +    else
> +        echo "Enabling RFC1918 network recursion";
> +        patch -p0 -b < /usr/local/share/recursion.patch -d /
> +    fi
>  else
> -     echo "Pulling config from $CUSTOM_CONFIG_REPO";
> -     if [ -d "${BIND_CONFDIR}" ]; then
> -             mv "${BIND_CONFDIR}" "${BIND_CONFDIR}_$(date 
> +"%Y-%m-%d_%H-%M-%S")";
> -     fi
> -     git clone "$CUSTOM_CONFIG_REPO" "$BIND_CONFDIR";
> +    if [ -d "${BIND_CONFDIR}" ]; then
> +        echo "Backing up old config";
> +        mv "${BIND_CONFDIR}" "${BIND_CONFDIR}_$(date +"%Y-%m-%d_%H-%M-%S")";
> +    fi
> +    echo "Pulling config from $CUSTOM_CONFIG_REPO";
> +    git clone "$CUSTOM_CONFIG_REPO" "$BIND_CONFDIR";
>  fi
>  
> -if [ -d "${BIND_CONFDIR}" ]; then
> -     exec "$@"
> -else
> -     echo "Something went wrong, ${BIND_CONFDIR} does not exist, not 
> starting";
> +if [ ! -d "${BIND_CONFDIR}" ]; then
> +    echo "Something went wrong, ${BIND_CONFDIR} does not exist, not 
> starting";
>  fi
>  
>  /usr/sbin/named -g -u bind -c /etc/bind/named.conf


-- 
https://code.launchpad.net/~barryprice/charm-k8s-bind/+git/charm-k8s-bind/+merge/403763
Your team Bind Charmers is subscribed to branch charm-k8s-bind:master.

-- 
Mailing list: https://launchpad.net/~bind-charmers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~bind-charmers
More help   : https://help.launchpad.net/ListHelp

Reply via email to