From 972a7d18c614f66856c2858e5a61b105b9e37979 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 6f509dbf4..292ea5436 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