How Do I Test A New External DNS Provider

I had this same problem when I wrote the DigitalOcean provider. This code is a little less well documented than I personally would prefer, but once I got my mind around the architecture everything went well.

Here is how I got around that problem:

#!/bin/bash
./scripts/build
cd bin/
tar cf ../packaging/external-dns.tar external-dns
gzip -f9 ../packaging/external-dns.tar
docker build -t registry.twilley.org/mathuin/external-dns ../packaging
docker push registry.twilley.org/mathuin/external-dns

This script basically builds the binary then archives it in a place where the packaging Dockerfile can access it, then it builds an image based on that Dockerfile and pushes it to my private registry where I can run tests against the image.

I also modified the packaging/Dockerfile to look like this:

FROM alpine:3.2
MAINTAINER Rancher Labs, Inc.
RUN apk add --update ca-certificates 

ENV EXT_DNS_RELEASE v0.6.1
#ADD https://github.com/rancher/external-dns/releases/download/${EXT_DNS_RELEASE}/external-dns.tar.gz /external-dns.tar.gz
COPY external-dns.tar.gz /external-dns.tar.gz
RUN tar -zxvf /external-dns.tar.gz -C /usr/bin

ENTRYPOINT ["/usr/bin/external-dns"]

This change uses the archived binary mentioned above instead of downloading straight from Rancher’s releases.

Let me know if there’s something I can do to help!