Skip to content

Commit

Permalink
linux bridge: Fix softlink path (#1592)
Browse files Browse the repository at this point in the history
The soft link should point to the real path on the host,
not to the mount path of the container.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2228240

Signed-off-by: Or Shoval <[email protected]>
  • Loading branch information
oshoval authored Aug 2, 2023
1 parent d681998 commit b1b4f8d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions data/linux-bridge/002-linux-bridge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@ spec:
- -ce
- |
cni_mount_dir=/opt/cni/bin
host_dir={{ .CNIBinDir }}
components=("bridge" "tuning")
for component in "${components[@]}"; do
if find "${cni_mount_dir}/${component}" &>/dev/null && ! test -L "${cni_mount_dir}/${component}"; then
echo "${component} binary found, creating symbolic link ${cni_mount_dir}/cnv-${component}"
ln -sf "${cni_mount_dir}/${component}" "${cni_mount_dir}/cnv-${component}"
ln -sf "${host_dir}/${component}" "${cni_mount_dir}/cnv-${component}"
else
echo "installing cnv-${component}, and creating symbolic link ${cni_mount_dir}/${component}"
Expand All @@ -54,7 +55,7 @@ spec:
printf -v component_checksum "%s" "$(<${sourcebinpath}/${component}.checksum)"
printf "%s %s" "${component_checksum% *}" "${cni_mount_dir}/cnv-${component}" | sha256sum --check
ln -sf "${cni_mount_dir}/cnv-${component}" "${cni_mount_dir}/${component}"
ln -sf "${host_dir}/cnv-${component}" "${cni_mount_dir}/${component}"
fi
done
echo 'Entering sleep... (success)'
Expand Down

0 comments on commit b1b4f8d

Please sign in to comment.