From 25c46c84b8b9664e754faff07a846c145399040e Mon Sep 17 00:00:00 2001 From: Tomofumi Hayashi Date: Mon, 8 Nov 2021 17:40:54 +0900 Subject: [PATCH] Added --cni-bin-dir and --multus-bin-file for regression --- images/entrypoint.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/images/entrypoint.sh b/images/entrypoint.sh index f44050cbd..453df469e 100755 --- a/images/entrypoint.sh +++ b/images/entrypoint.sh @@ -44,9 +44,11 @@ function usage() echo -e "" echo -e "./entrypoint.sh" echo -e "\t-h --help" + echo -e "\t--cni-bin-dir=$CNI_BIN_DIR" echo -e "\t--cni-conf-dir=$CNI_CONF_DIR" echo -e "\t--cni-version=" echo -e "\t--multus-conf-file=$MULTUS_CONF_FILE" + echo -e "\t--multus-bin-file=$MULTUS_BIN_FILE" echo -e "\t--skip-multus-binary-copy=$SKIP_BINARY_COPY" echo -e "\t--multus-kubeconfig-file-host=$MULTUS_KUBECONFIG_FILE_HOST" echo -e "\t--multus-master-cni-file-name=$MULTUS_MASTER_CNI_FILE_NAME (empty by default, example: 10-calico.conflist)" @@ -95,9 +97,15 @@ while [ "$1" != "" ]; do --cni-version) CNI_VERSION=$VALUE ;; + --cni-bin-dir) + CNI_BIN_DIR=$VALUE + ;; --cni-conf-dir) CNI_CONF_DIR=$VALUE ;; + --cni-bin-dir) + CNI_BIN_DIR=$VALUE + ;; --multus-conf-file) MULTUS_CONF_FILE=$VALUE ;; @@ -155,7 +163,7 @@ done # Create array of known locations -declare -a arr=($CNI_CONF_DIR) +declare -a arr=($CNI_CONF_DIR $CNI_BIN_DIR $MULTUS_BIN_FILE) if [ "$MULTUS_CONF_FILE" != "auto" ]; then arr+=($MULTUS_CONF_FILE) fi @@ -170,6 +178,14 @@ do fi done +# Copy files into place and atomically move into final binary name +if [ "$SKIP_BINARY_COPY" = false ]; then + cp -f $MULTUS_BIN_FILE $CNI_BIN_DIR/_multus + mv -f $CNI_BIN_DIR/_multus $CNI_BIN_DIR/multus +else + log "Entrypoint skipped copying Multus binary." +fi + if [ "$MULTUS_CONF_FILE" != "auto" ]; then cp -f $MULTUS_CONF_FILE $CNI_CONF_DIR fi