Skip to content

Commit

Permalink
Explicit list of switch roles and IsSpine helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Frostman committed Nov 10, 2023
1 parent 8fa1a16 commit 57e0a5c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions api/wiring/v1alpha2/switch_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ const (
SwitchRoleBorderLeaf SwitchRole = "border-leaf"
)

var SwitchRoles = []SwitchRole{
SwitchRoleSpine,
SwitchRoleServerLeaf,
SwitchRoleBorderLeaf,
}

func (r SwitchRole) IsSpine() bool {
return r == SwitchRoleSpine
}

func (r SwitchRole) IsLeaf() bool {
return r == SwitchRoleServerLeaf || r == SwitchRoleBorderLeaf
}
Expand Down

0 comments on commit 57e0a5c

Please sign in to comment.