Skip to content

Commit

Permalink
change naming
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmasi committed Oct 30, 2023
1 parent e6d8e9f commit 64d1e56
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions topo/node/keysight/keysight.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
12 changes: 6 additions & 6 deletions topo/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
}
6 changes: 3 additions & 3 deletions topo/topo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion topo/topo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ type loopbackable struct {
*node.Impl
}

func (l *loopbackable) HardwareLoopbackSupported() bool {
func (l *loopbackable) BackToBackLoop() bool {
return true
}

Expand Down

0 comments on commit 64d1e56

Please sign in to comment.