Merge pull request #2598 from weaveworks/cni-setup-remove-symlink

Clean up CNI symlinks from weave-kube
This commit is contained in:
Marc Carré authored and GitHub committed 2016-11-04 15:28:44 +00:00
commit 5352ed837a
1 file changed
+5
+5
View File
@@ -1028,6 +1028,11 @@ peer_args() {
######################################################################
create_cni_script() {
# If target file is a symlink, it's probably a remnant of a weave-kube
# installation - if the user has now switched back to `weave launch`,
# we need to remove the link before rewriting the contents:
[ -L "$1" ] && rm "$1" # fail if we can't remove the link
cat >"$1" <<EOF
#!/bin/sh
[ -z "\$CNI_NETNS" -o \$(echo "\$CNI_NETNS" | grep "^/proc/") ] || \\