kuryr-kubernetes/cni_builder
Antoni Segura Puimedon 460cab6a99 CNI container: parametrize and clean up
Make the CNI config and binary locations parametrized so it is suitable
for more kinds of deployment.

Implements: blueprint kubeadminstallable
Change-Id: I01c7540641fe120faec902008ebd842339b50384
Signed-off-by: Antoni Segura Puimedon <antonisp@celebdor.com>
Co-Authored-By: Michał Dulko <mdulko@redhat.com>
2017-09-14 13:33:53 +02:00

14 lines
523 B
Bash

#!/bin/bash -ex
rm -f /opt/kuryr-kubernetes/kuryr-cni
rm -f /opt/kuryr-kubernetes/kuryr-cni-bin
pbr_version=$(find /usr/local/lib/python3.5/site-packages/ -type d \
-name 'kuryr_kubernetes*info' -exec basename {} \; \
| awk -F"-" '{sub(/\.dist/,"",$2); print $2}')
cat > /opt/kuryr-kubernetes/kuryr-cni << EOF
#!/bin/bash
export PBR_VERSION='$pbr_version'
${CNI_BIN_DIR_PATH}/kuryr-cni-bin
EOF
cp /dist/kuryr-cni /opt/kuryr-kubernetes/kuryr-cni-bin
chmod 744 /opt/kuryr-kubernetes/kuryr-cni