Remove vlanLinkExists and dummyLinkExists since these are redundant

Signed-off-by: Arko Dasgupta <arko.dasgupta@docker.com>
This commit is contained in:
Arko Dasgupta 2019-07-25 15:37:04 -07:00
parent d22824dc11
commit 402efabec5
2 changed files with 0 additions and 54 deletions

View file

@ -70,22 +70,8 @@ func parentExists(ifaceStr string) bool {
return true
}
// vlanLinkExists checks if specified vlan link exists in the default namespace
func vlanLinkExists(linkStr string) bool {
_, err := ns.NlHandle().LinkByName(linkStr)
if err != nil {
return false
}
return true
}
// createVlanLink parses sub-interfaces and vlan id for creation
func createVlanLink(parentName string) error {
if vlanLinkExists(parentName) {
logrus.Debugf("Parent Sub Interface %s already exists", parentName)
return nil
}
if strings.Contains(parentName, ".") {
parent, vidInt, err := parseVlan(parentName)
if err != nil {
@ -170,22 +156,8 @@ func parseVlan(linkName string) (string, int, error) {
return parent, vidInt, nil
}
// dummyLinkExists checks if dummylink exists in the default namespace
func dummyLinkExists(dummyName string) bool {
_, err := ns.NlHandle().LinkByName(dummyName)
if err != nil {
return false
}
return true
}
// createDummyLink creates a dummy0 parent link
func createDummyLink(dummyName, truncNetID string) error {
// check if dummyLinkExists and return if it does
if dummyLinkExists(truncNetID) {
logrus.Debugf("Dummy Link %s for ipvlan already exists", truncNetID)
return nil
}
// create a parent interface since one was not specified
parent := &netlink.Dummy{
LinkAttrs: netlink.LinkAttrs{

View file

@ -74,21 +74,8 @@ func parentExists(ifaceStr string) bool {
return true
}
// vlanLinkExists checks if specified vlan link exists in the default namespace
func vlanLinkExists(linkStr string) bool {
_, err := ns.NlHandle().LinkByName(linkStr)
if err != nil {
return false
}
return true
}
// createVlanLink parses sub-interfaces and vlan id for creation
func createVlanLink(parentName string) error {
if vlanLinkExists(parentName) {
logrus.Debugf("Parent Sub Interface %s already exists", parentName)
return nil
}
if strings.Contains(parentName, ".") {
parent, vidInt, err := parseVlan(parentName)
if err != nil {
@ -173,21 +160,8 @@ func parseVlan(linkName string) (string, int, error) {
return parent, vidInt, nil
}
// dummyLinkExists checks if dummylink exists in the default namespace
func dummyLinkExists(dummyName string) bool {
_, err := ns.NlHandle().LinkByName(dummyName)
if err != nil {
return false
}
return true
}
// createDummyLink creates a dummy0 parent link
func createDummyLink(dummyName, truncNetID string) error {
if dummyLinkExists(truncNetID) {
logrus.Debugf("Dummy Link %s for Mac Vlan already exists", truncNetID)
return nil
}
// create a parent interface since one was not specified
parent := &netlink.Dummy{
LinkAttrs: netlink.LinkAttrs{