Skip to content

Commit

Permalink
handle default vlan for fsos
Browse files Browse the repository at this point in the history
  • Loading branch information
msniveau committed Oct 11, 2023
1 parent 0417ffc commit 5e8a249
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/vendors/fsos/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ func (fs *FSOS) ConfigureInterface(update *models.UpdateInterface) (bool, error)
commands = append(commands, fmt.Sprintf("description %s", *update.Description)) // set interface description
}

if update.UntaggedVLAN != nil {
if update.UntaggedVLAN != nil && *update.UntaggedVLAN != 1 {
commands = append(commands, fmt.Sprintf("switchport trunk native vlan %d", *update.UntaggedVLAN)) // set untagged vlan
} else if update.UntaggedVLAN != nil && *update.UntaggedVLAN == 1 {
commands = append(commands, fmt.Sprintf("no switchport trunk native vlan"))

Check failure on line 88 in pkg/vendors/fsos/interfaces.go

View workflow job for this annotation

GitHub Actions / lint

S1039: unnecessary use of fmt.Sprintf (gosimple)
}

if update.TaggedVLANs != nil {
Expand Down

0 comments on commit 5e8a249

Please sign in to comment.