Skip to content
Permalink
Browse files

Skips binary copy in entrypoint with new parameter

  • Loading branch information
dougbtv authored and s1061123 committed Nov 6, 2019
1 parent c7f9571 commit ecc474a26425fd5e6d1b75468a479a24e58add91
Showing with 16 additions and 2 deletions.
  1. +4 −0 doc/how-to-use.md
  2. +12 −2 images/entrypoint.sh
@@ -615,3 +615,7 @@ Additionally when using CRIO, you may wish to have the CNI config file that's us
When using `--multus-conf-file=auto` you may also care to specify a `binDir` in the configuration, this can be accomplished using the `--additional-bin-dir` option. When using `--multus-conf-file=auto` you may also care to specify a `binDir` in the configuration, this can be accomplished using the `--additional-bin-dir` option.


--additional-bin-dir=/opt/multus/bin --additional-bin-dir=/opt/multus/bin

Sometimes, you may wish to not have the entrypoint copy the binary file onto the host. Potentially, you have another way to copy in a specific version of Multus, for example. By default, it's always copied, but you may disable the copy with:

--skip-multus-binary-copy=true
@@ -33,6 +33,7 @@ MULTUS_CLEANUP_CONFIG_ON_EXIT=false
RESTART_CRIO=false RESTART_CRIO=false
CRIO_RESTARTED_ONCE=false CRIO_RESTARTED_ONCE=false
RENAME_SOURCE_CONFIG_FILE=false RENAME_SOURCE_CONFIG_FILE=false
SKIP_BINARY_COPY=false


# Give help text for parameters. # Give help text for parameters.
function usage() function usage()
@@ -51,6 +52,7 @@ function usage()
echo -e "\t--cni-version=<cniVersion (e.g. 0.3.1)>" echo -e "\t--cni-version=<cniVersion (e.g. 0.3.1)>"
echo -e "\t--multus-conf-file=$MULTUS_CONF_FILE" echo -e "\t--multus-conf-file=$MULTUS_CONF_FILE"
echo -e "\t--multus-bin-file=$MULTUS_BIN_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-kubeconfig-file-host=$MULTUS_KUBECONFIG_FILE_HOST"
echo -e "\t--namespace-isolation=$MULTUS_NAMESPACE_ISOLATION" echo -e "\t--namespace-isolation=$MULTUS_NAMESPACE_ISOLATION"
echo -e "\t--multus-autoconfig-dir=$MULTUS_AUTOCONF_DIR (used only with --multus-conf-file=auto)" echo -e "\t--multus-autoconfig-dir=$MULTUS_AUTOCONF_DIR (used only with --multus-conf-file=auto)"
@@ -132,6 +134,9 @@ while [ "$1" != "" ]; do
--additional-bin-dir) --additional-bin-dir)
ADDITIONAL_BIN_DIR=$VALUE ADDITIONAL_BIN_DIR=$VALUE
;; ;;
--skip-multus-binary-copy)
SKIP_BINARY_COPY=$VALUE
;;
*) *)
warn "unknown parameter \"$PARAM\"" warn "unknown parameter \"$PARAM\""
;; ;;
@@ -157,8 +162,13 @@ do
done done


# Copy files into place and atomically move into final binary name # Copy files into place and atomically move into final binary name
cp -f $MULTUS_BIN_FILE $CNI_BIN_DIR/_multus if [ "$SKIP_BINARY_COPY" = false ]; then
mv -f $CNI_BIN_DIR/_multus $CNI_BIN_DIR/multus 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 if [ "$MULTUS_CONF_FILE" != "auto" ]; then
cp -f $MULTUS_CONF_FILE $CNI_CONF_DIR cp -f $MULTUS_CONF_FILE $CNI_CONF_DIR
fi fi

0 comments on commit ecc474a

Please sign in to comment.
You can’t perform that action at this time.