kolla-kubernetes/tools/setup-resolv-conf.sh
Kevin Fox b8054c6a21 Kolla Kubernetes Gate Test
This PS creates a gate test for kolla-kubernetes. It does an all in
one deployment backed with ceph.

In addition, it:
 * Adds a bindep.txt file to give our tests quicker install times.
 * Adds a bashate tox test for linting bash.
 * Fixes a bug with multiple pods passed on the command line at
   once.

Change-Id: I29d928b9864e268542a8a51d86b566e4933557bf
2016-10-01 18:41:18 -07:00

16 lines
664 B
Bash
Executable File

#!/bin/bash -e
NAMESPACE=$(kolla-kubernetes resource-template create bootstrap neutron-create-db -o json | jq -r '.metadata.namespace')
TOOLBOX=$(kolla-kubernetes resource-template create bootstrap neutron-create-db -o json | jq -r '.spec.template.spec.containers[0].image')
function finish {
kubectl run -i --rm fetchresolv --restart=Never --namespace=$NAMESPACE --image=$TOOLBOX -- /bin/bash -c 'cat /etc/resolv.conf' | egrep '^search|^nameserver|^options' > /tmp/$$
kubectl create configmap resolv-conf --from-file=resolv.conf=/tmp/$$ --namespace $NAMESPACE
rm -f /tmp/$$
}
if [ "x$1" == "x--partial-async" ]; then
finish &
else
finish
fi