Skip to content

Commit

Permalink
feat(network): dhcp_routes to IP network (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
villevsv-upcloud committed Sep 27, 2023
1 parent c9603a0 commit 9fc8e4d
Show file tree
Hide file tree
Showing 6 changed files with 178 additions and 129 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]

### Added

- network: `dhcp_routes` field to IP network for additional DHCP classless static routes to be delivered if the DHCP is enabled

## [6.6.0]

### Added
Expand Down
1 change: 1 addition & 0 deletions upcloud/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ type IPNetwork struct {
DHCP Boolean `json:"dhcp"`
DHCPDefaultRoute Boolean `json:"dhcp_default_route"`
DHCPDns []string `json:"dhcp_dns,omitempty"`
DHCPRoutes []string `json:"dhcp_routes,omitempty"`
Family string `json:"family,omitempty"`
Gateway string `json:"gateway,omitempty"`
}
Expand Down
8 changes: 8 additions & 0 deletions upcloud/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ func TestUnmarshalNetwork(t *testing.T) {
"172.16.0.10",
"172.16.1.10"
],
"dhcp_routes" : [
"192.168.0.0/24",
"192.168.100.100/32"
],
"family": "IPv4",
"gateway": "172.16.0.1"
}
Expand Down Expand Up @@ -231,6 +235,10 @@ func TestUnmarshalNetwork(t *testing.T) {
"172.16.0.10",
"172.16.1.10",
},
DHCPRoutes: []string{
"192.168.0.0/24",
"192.168.100.100/32",
},
Family: IPAddressFamilyIPv4,
Gateway: "172.16.0.1",
},
Expand Down
8 changes: 8 additions & 0 deletions upcloud/request/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ func TestMarshalCreateNetworkRequest(t *testing.T) {
"172.16.0.10",
"172.16.1.10",
},
DHCPRoutes: []string{
"192.168.0.0/24",
"192.168.100.100/32",
},
Family: upcloud.IPAddressFamilyIPv4,
Gateway: "172.16.0.1",
},
Expand Down Expand Up @@ -106,6 +110,10 @@ func TestMarshalCreateNetworkRequest(t *testing.T) {
"172.16.0.10",
"172.16.1.10"
],
"dhcp_routes" : [
"192.168.0.0/24",
"192.168.100.100/32"
],
"family" : "IPv4",
"gateway" : "172.16.0.1"
}
Expand Down
Loading

0 comments on commit 9fc8e4d

Please sign in to comment.