mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-08-02 00:19:10 +00:00
[entrypoint] Adds script parameter to optionally rename source CNI config file to .old
This commit is contained in:
parent
56f42e0b51
commit
e2f75d4ee5
@ -541,3 +541,7 @@ In some cases, the original CNI configuration that the Multus configuration was
|
|||||||
When using CRIO, you may need to restart CRIO to get the Multus configuration file to take -- this is rarely necessary.
|
When using CRIO, you may need to restart CRIO to get the Multus configuration file to take -- this is rarely necessary.
|
||||||
|
|
||||||
--restart-crio=false
|
--restart-crio=false
|
||||||
|
|
||||||
|
Additionally when using CRIO, you may wish to have the CNI config file that's used as the source for `--multus-conf-file=auto` renamed. This boolean option when set to true automatically renames the file with a `.old` suffix to the original filename.
|
||||||
|
|
||||||
|
--rename-conf-file=true
|
||||||
|
@ -31,6 +31,7 @@ OVERRIDE_NETWORK_NAME=false
|
|||||||
MULTUS_CLEANUP_CONFIG_ON_EXIT=false
|
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
|
||||||
|
|
||||||
# Give help text for parameters.
|
# Give help text for parameters.
|
||||||
function usage()
|
function usage()
|
||||||
@ -56,6 +57,7 @@ function usage()
|
|||||||
echo -e "\t--multus-log-file=$MULTUS_LOG_FILE (empty by default, used only with --multus-conf-file=auto)"
|
echo -e "\t--multus-log-file=$MULTUS_LOG_FILE (empty by default, used only with --multus-conf-file=auto)"
|
||||||
echo -e "\t--override-network-name=false (used only with --multus-conf-file=auto)"
|
echo -e "\t--override-network-name=false (used only with --multus-conf-file=auto)"
|
||||||
echo -e "\t--cleanup-config-on-exit=false (used only with --multus-conf-file=auto)"
|
echo -e "\t--cleanup-config-on-exit=false (used only with --multus-conf-file=auto)"
|
||||||
|
echo -e "\t--rename-conf-file=false (used only with --multus-conf-file=auto)"
|
||||||
echo -e "\t--restart-crio=false (restarts CRIO after config file is generated)"
|
echo -e "\t--restart-crio=false (restarts CRIO after config file is generated)"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,6 +124,9 @@ while [ "$1" != "" ]; do
|
|||||||
--restart-crio)
|
--restart-crio)
|
||||||
RESTART_CRIO=$VALUE
|
RESTART_CRIO=$VALUE
|
||||||
;;
|
;;
|
||||||
|
--rename-conf-file)
|
||||||
|
RENAME_SOURCE_CONFIG_FILE=$VALUE
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
warn "unknown parameter \"$PARAM\""
|
warn "unknown parameter \"$PARAM\""
|
||||||
;;
|
;;
|
||||||
@ -310,7 +315,7 @@ EOF
|
|||||||
echo $CONF
|
echo $CONF
|
||||||
|
|
||||||
# If we're not performing the cleanup on exit, we can safely rename the config file.
|
# If we're not performing the cleanup on exit, we can safely rename the config file.
|
||||||
if [ "$MULTUS_CLEANUP_CONFIG_ON_EXIT" == false ]; then
|
if [ "$RENAME_SOURCE_CONFIG_FILE" == true ]; then
|
||||||
mv ${MULTUS_AUTOCONF_DIR}/${MASTER_PLUGIN} ${MULTUS_AUTOCONF_DIR}/${MASTER_PLUGIN}.old
|
mv ${MULTUS_AUTOCONF_DIR}/${MASTER_PLUGIN} ${MULTUS_AUTOCONF_DIR}/${MASTER_PLUGIN}.old
|
||||||
log "Original master file moved to ${MULTUS_AUTOCONF_DIR}/${MASTER_PLUGIN}.old"
|
log "Original master file moved to ${MULTUS_AUTOCONF_DIR}/${MASTER_PLUGIN}.old"
|
||||||
fi
|
fi
|
||||||
|
@ -141,6 +141,7 @@ spec:
|
|||||||
- "--cni-bin-dir=/host/usr/libexec/cni"
|
- "--cni-bin-dir=/host/usr/libexec/cni"
|
||||||
- "--multus-conf-file=auto"
|
- "--multus-conf-file=auto"
|
||||||
- "--override-network-name=true"
|
- "--override-network-name=true"
|
||||||
|
- "--rename-conf-file=true"
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: "100m"
|
cpu: "100m"
|
||||||
|
Loading…
Reference in New Issue
Block a user