Skip to content
This repository has been archived by the owner on Jan 23, 2022. It is now read-only.

Perform preemption check only when used as a chained plugin #256

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions deployments/kubernetes/install/scripts/install-cni.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,17 @@ function find_cni_conf_file() {
}

function check_install() {
cfgfile_nm=$(find_cni_conf_file)
if [ "${cfgfile_nm}" != "${CNI_CONF_NAME}" ]; then
if [ -n "${CNI_CONF_NAME_OVERRIDE}" ]; then
# Install was run with overridden cni config file so don't error out on the preempt check.
# Likely the only use for this is testing this script.
echo "WARNING: Configured CNI config file \"${MOUNTED_CNI_NET_DIR}/${CNI_CONF_NAME}\" preempted by \"$cfgfile_nm\"."
else
echo "ERROR: CNI config file \"${MOUNTED_CNI_NET_DIR}/${CNI_CONF_NAME}\" preempted by \"$cfgfile_nm\"."
exit 1
if [ "${CHAINED_CNI_PLUGIN}" == "true" ]; then
cfgfile_nm=$(find_cni_conf_file)
if [ "${cfgfile_nm}" != "${CNI_CONF_NAME}" ]; then
if [ -n "${CNI_CONF_NAME_OVERRIDE}" ]; then
# Install was run with overridden cni config file so don't error out on the preempt check.
# Likely the only use for this is testing this script.
echo "WARNING: Configured CNI config file \"${MOUNTED_CNI_NET_DIR}/${CNI_CONF_NAME}\" preempted by \"$cfgfile_nm\"."
else
echo "ERROR: CNI config file \"${MOUNTED_CNI_NET_DIR}/${CNI_CONF_NAME}\" preempted by \"$cfgfile_nm\"."
exit 1
fi
fi
fi
if [ -e "${MOUNTED_CNI_NET_DIR}/${CNI_CONF_NAME}" ]; then
Expand Down