mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-10-21 15:30:24 +00:00
[entrypoint] Adds CRIO restart
Co-authored-by: s1061123 <tohayash@redhat.com>
This commit is contained in:
committed by
Tomofumi Hayashi
parent
b38ab9771c
commit
b2e1098ab5
@@ -29,6 +29,7 @@ MULTUS_LOG_LEVEL=""
|
||||
MULTUS_LOG_FILE=""
|
||||
OVERRIDE_NETWORK_NAME=false
|
||||
MULTUS_CLEANUP_CONFIG_ON_EXIT=false
|
||||
RESTART_CRIO=false
|
||||
|
||||
# Give help text for parameters.
|
||||
function usage()
|
||||
@@ -54,6 +55,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--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--restart-crio=false (restarts CRIO after config file is generated)"
|
||||
}
|
||||
|
||||
function log()
|
||||
@@ -116,6 +118,9 @@ while [ "$1" != "" ]; do
|
||||
--cleanup-config-on-exit)
|
||||
MULTUS_CLEANUP_CONFIG_ON_EXIT=$VALUE
|
||||
;;
|
||||
--restart-crio)
|
||||
RESTART_CRIO=$VALUE
|
||||
;;
|
||||
*)
|
||||
warn "unknown parameter \"$PARAM\""
|
||||
;;
|
||||
@@ -302,6 +307,11 @@ EOF
|
||||
echo $CONF > $CNI_CONF_DIR/00-multus.conf
|
||||
log "Config file created @ $CNI_CONF_DIR/00-multus.conf"
|
||||
echo $CONF
|
||||
|
||||
if [ "$RESTART_CRIO" == true ]; then
|
||||
log "Restarting crio"
|
||||
systemctl restart crio
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
@@ -150,7 +150,11 @@ spec:
|
||||
memory: "50Mi"
|
||||
securityContext:
|
||||
privileged: true
|
||||
capabilities:
|
||||
add: ["SYS_ADMIN"]
|
||||
volumeMounts:
|
||||
- name: run
|
||||
mountPath: /run
|
||||
- name: cni
|
||||
mountPath: /host/etc/cni/net.d
|
||||
- name: cnibin
|
||||
@@ -158,6 +162,9 @@ spec:
|
||||
- name: multus-cfg
|
||||
mountPath: /tmp/multus-conf
|
||||
volumes:
|
||||
- name: run
|
||||
hostPath:
|
||||
path: /run
|
||||
- name: cni
|
||||
hostPath:
|
||||
path: /etc/cni/net.d
|
||||
|
Reference in New Issue
Block a user