From 64d1e56881eca1b95724b302feeb8cfd47fe16d7 Mon Sep 17 00:00:00 2001 From: Alex Masi Date: Mon, 30 Oct 2023 23:12:39 +0000 Subject: [PATCH] change naming --- topo/node/keysight/keysight.go | 4 ++-- topo/node/node.go | 12 ++++++------ topo/topo.go | 6 +++--- topo/topo_test.go | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/topo/node/keysight/keysight.go b/topo/node/keysight/keysight.go index 6c0a4801..fb4cc8a8 100644 --- a/topo/node/keysight/keysight.go +++ b/topo/node/keysight/keysight.go @@ -322,8 +322,8 @@ func (n *Node) FixInterfaces() { } } -func (n *Node) HardwareLoopbackSupported() bool { - // IxiaTG supports hardware loopback due to the node implementation creating +func (n *Node) BackToBackLoop() bool { + // IxiaTG supports back to back loops due to the node implementation creating // a pod per port. return true } diff --git a/topo/node/node.go b/topo/node/node.go index 20cfbab7..e2c761f8 100644 --- a/topo/node/node.go +++ b/topo/node/node.go @@ -58,9 +58,9 @@ type Implementation interface { // Services provides a custom implementation for querying all services created for // for a node. Requires context, Kubernetes client interface and namespace. Services(context.Context) ([]*corev1.Service, error) - // HardwareLoopbackSupported returns a bool if the node supports hardware - // loopback, i.e. a linked can connect two ports on the same node. - HardwareLoopbackSupported() bool + // BackToBackLoop returns a bool if the node supports links directly between + // two ports on the same node. + BackToBackLoop() bool } // Certer provides an interface for working with certs on nodes. @@ -749,8 +749,8 @@ func (n *Impl) GetCLIConn(platform string, opts []scrapliutil.Option) (*scraplin } } -// HardwareLoopbackSupported returns a bool indicating if the node supports a -// single link connecting two ports on the same node. By default this is false. -func (n *Impl) HardwareLoopbackSupported() bool { +// BackToBackLoop returns a bool indicating if the node supports a single link +// connecting two ports on the same node. By default this is false. +func (n *Impl) BackToBackLoop() bool { return false } diff --git a/topo/topo.go b/topo/topo.go index fe0959c4..fef3fc42 100644 --- a/topo/topo.go +++ b/topo/topo.go @@ -474,9 +474,9 @@ func (m *Manager) load() error { for _, l := range m.topo.Links { aNode := m.nodes[l.ANode] zNode := m.nodes[l.ZNode] - loopbackSupported := aNode.HardwareLoopbackSupported() && zNode.HardwareLoopbackSupported() - if !loopbackSupported && l.ANode == l.ZNode { - return fmt.Errorf("invalid link: hardware loopback %s:%s %s:%s not supported", l.ANode, l.AInt, l.ZNode, l.ZInt) + loop := aNode.BackToBackLoop() && zNode.BackToBackLoop() + if !loop && l.ANode == l.ZNode { + return fmt.Errorf("invalid link: back to back loop %s:%s %s:%s not supported", l.ANode, l.AInt, l.ZNode, l.ZInt) } } return nil diff --git a/topo/topo_test.go b/topo/topo_test.go index c141be9a..685d117b 100644 --- a/topo/topo_test.go +++ b/topo/topo_test.go @@ -97,7 +97,7 @@ type loopbackable struct { *node.Impl } -func (l *loopbackable) HardwareLoopbackSupported() bool { +func (l *loopbackable) BackToBackLoop() bool { return true }