#!/bin/bash
#
# Copyright (c) 2019-2021 Oracle and/or its affiliates. All rights reserved.
# Licensed under the GNU General Public License Version 3 as shown at https://www.gnu.org/licenses/gpl-3.0.txt.

whitelist="cni0
kube-ipvs0
vxlan.calico
"

if echo "$whitelist" | grep -q -x "$1"; then
	/sbin/ip link del $1
	exit 0
fi


if echo "$1" | grep -q 'flannel'; then
	/sbin/ip link del $1
	exit 0
fi

echo "$1 is indelible by this script"
exit 1
