From d7e8809cf8ba1f6bcbb45f3c39349365f0dbfa7b Mon Sep 17 00:00:00 2001 From: dougbtv Date: Tue, 22 Jan 2019 10:38:02 -0500 Subject: [PATCH] [entrypoint] Updates entrypoint for atomic move of binary (for cleaner upgrade) --- images/entrypoint.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/images/entrypoint.sh b/images/entrypoint.sh index f5d875aaa..fb23940e6 100755 --- a/images/entrypoint.sh +++ b/images/entrypoint.sh @@ -84,8 +84,9 @@ do fi done -# Copy files into proper places. -cp -f $MULTUS_BIN_FILE $CNI_BIN_DIR +# Copy files into place and atomically move into final binary name +cp -f $MULTUS_BIN_FILE $CNI_BIN_DIR/_multus +mv -f $CNI_BIN_DIR/_multus $CNI_BIN_DIR/multus if [ "$MULTUS_CONF_FILE" != "auto" ]; then cp -f $MULTUS_CONF_FILE $CNI_CONF_DIR fi