From 8295a28f6d6e14f5adb62138271de393015061e9 Mon Sep 17 00:00:00 2001 From: Ritu Sood Date: Tue, 6 Aug 2019 19:35:42 -0700 Subject: Use controller runtime and operator sdk Changing the framework to use controller runtime and operator sdk. This allows to add CRD controllers for Network, Provider Network etc in the same operator. Binary renamed to nfn-operator (Network funtion networking). Change-Id: Ic25a3c3f5f1418fc0614f3aede48b41d9c1156cd Signed-off-by: Ritu Sood --- build/bin/entrypoint | 27 +++++++++++++++++++++++++++ build/bin/user_setup | 13 +++++++++++++ 2 files changed, 40 insertions(+) create mode 100755 build/bin/entrypoint create mode 100755 build/bin/user_setup (limited to 'build/bin') diff --git a/build/bin/entrypoint b/build/bin/entrypoint new file mode 100755 index 0000000..af0d88a --- /dev/null +++ b/build/bin/entrypoint @@ -0,0 +1,27 @@ +#!/bin/sh -e + + +cmd=${1:-""} + +case ${cmd} in + "cni") + CNI_BIN_DIR="/host/opt/cni/bin" + OVN4NFV_CONF_DIR="/host/etc/openvswitch" + OVN4NFV_BIN_FILE="/usr/local/bin/ovn4nfvk8s-cni" + OVN4NFV_CONF_FILE="/tmp/ovn4nfv-conf/ovn4nfv_k8s.conf" + cp -f $OVN4NFV_BIN_FILE $CNI_BIN_DIR + cp -f $OVN4NFV_CONF_FILE $OVN4NFV_CONF_DIR + # Sleep forever. + sleep infinity + ;; + + "operator") + shift + exec ${OPERATOR} $@ + ;; + + *) + echo "invalid command ${cmd}" + +esac + diff --git a/build/bin/user_setup b/build/bin/user_setup new file mode 100755 index 0000000..1e36064 --- /dev/null +++ b/build/bin/user_setup @@ -0,0 +1,13 @@ +#!/bin/sh +set -x + +# ensure $HOME exists and is accessible by group 0 (we don't know what the runtime UID will be) +mkdir -p ${HOME} +chown ${USER_UID}:0 ${HOME} +chmod ug+rwx ${HOME} + +# runtime user will need to be able to self-insert in /etc/passwd +chmod g+rw /etc/passwd + +# no need for this script to remain in the image after running +rm $0 -- cgit 1.2.3-korg