mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-08-27 20:38:47 +00:00
Merge pull request #50 from dougbtv/test-no-config-invalidation
Removes configuration invalidation
This commit is contained in:
commit
7219de04e6
@ -3,20 +3,6 @@
|
|||||||
# Always exit on errors.
|
# Always exit on errors.
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Run a clean up when we exit if configured to do so.
|
|
||||||
trap cleanup TERM
|
|
||||||
function cleanup {
|
|
||||||
if [ "$MULTUS_CLEANUP_CONFIG_ON_EXIT" == "true" ]; then
|
|
||||||
CONF=$(cat <<-EOF
|
|
||||||
{Multus configuration intentionally invalidated to prevent pods from being scheduled.}
|
|
||||||
EOF
|
|
||||||
)
|
|
||||||
echo $CONF > $CNI_CONF_DIR/00-multus.conf
|
|
||||||
log "Multus configuration intentionally invalidated to prevent pods from being scheduled."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Set our known directories.
|
# Set our known directories.
|
||||||
CNI_CONF_DIR="/host/etc/cni/net.d"
|
CNI_CONF_DIR="/host/etc/cni/net.d"
|
||||||
CNI_BIN_DIR="/host/opt/cni/bin"
|
CNI_BIN_DIR="/host/opt/cni/bin"
|
||||||
@ -255,13 +241,6 @@ if [ "$MULTUS_CONF_FILE" == "auto" ]; then
|
|||||||
log "Attemping to find master plugin configuration, attempt $tries"
|
log "Attemping to find master plugin configuration, attempt $tries"
|
||||||
fi
|
fi
|
||||||
let "tries+=1"
|
let "tries+=1"
|
||||||
# See if the Multus configuration file exists, if it does then clean it up.
|
|
||||||
if [ "$MULTUS_CLEANUP_CONFIG_ON_EXIT" == true ] && [ -f "$CNI_CONF_DIR/00-multus.conf" ]; then
|
|
||||||
# But first, check if it has the invalidated configuration in it (otherwise we keep doing this over and over.)
|
|
||||||
if ! grep -q "invalidated" $CNI_CONF_DIR/00-multus.conf; then
|
|
||||||
cleanup
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
sleep 1;
|
sleep 1;
|
||||||
else
|
else
|
||||||
error "Multus could not be configured: no master plugin was found."
|
error "Multus could not be configured: no master plugin was found."
|
||||||
@ -386,10 +365,6 @@ if [ "$MULTUS_CLEANUP_CONFIG_ON_EXIT" == true ]; then
|
|||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ ! -f "$MASTER_PLUGIN_LOCATION" ]; then
|
|
||||||
log "Master plugin @ $MASTER_PLUGIN_LOCATION has not been restored, beginning regeneration."
|
|
||||||
cleanup
|
|
||||||
fi
|
|
||||||
generateMultusConf
|
generateMultusConf
|
||||||
log "Continuing watch loop after configuration regeneration..."
|
log "Continuing watch loop after configuration regeneration..."
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user