Skip to content

Commit

Permalink
fix: parse corrected spelling of gratuitous-arp in Netplan
Browse files Browse the repository at this point in the history
Netplan fixed this spelling, which breaks us on newer version. We now
parse both the new correct spelling and the old incorrect one.
  • Loading branch information
manadart committed Feb 14, 2025
1 parent 088866a commit 539715c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions network/netplan/netplan.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ type BondParameters struct {
UpDelay IntString `yaml:"up-delay,omitempty"`
DownDelay IntString `yaml:"down-delay,omitempty"`
FailOverMACPolicy IntString `yaml:"fail-over-mac-policy,omitempty"`
// Netplan misspelled this as 'gratuitious-arp', not sure if it works with that name.
// We may need custom handling of both spellings.
GratuitousARP *int `yaml:"gratuitious-arp,omitempty"` // nolint: misspell
// Netplan misspelled this and retained it along with the corrected spelling.
GratuitousARPLegacy *int `yaml:"gratuitious-arp,omitempty"` // nolint: misspell
GratuitousARP *int `yaml:"gratuitous-arp,omitempty"`
PacketsPerSlave *int `yaml:"packets-per-slave,omitempty"`
PrimaryReselectPolicy IntString `yaml:"primary-reselect-policy,omitempty"`
ResendIGMP *int `yaml:"resend-igmp,omitempty"`
Expand Down
1 change: 1 addition & 0 deletions network/netplan/netplan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,7 @@ network:
macaddress: "00:11:22:33:44:77"
parameters:
primary: eno3
gratuitous-arp: 1
`[1:]
np := MustNetplanFromYaml(c, input)

Expand Down

0 comments on commit 539715c

Please sign in to comment.