Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename field HardwareAddr to PhysicalInterface #195

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fake_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ func (c *FakeClient) CreateNetwork(config NetworkConfig) (*NetworkResult, error)
// Handle VLAN configuration if present
if config.VLanConfig != nil {
newNetwork.VlanID = config.VLanConfig.VlanID
newNetwork.HardwareAddr = config.VLanConfig.HardwareAddr
newNetwork.PhysicalInterface = config.VLanConfig.PhysicalInterface
newNetwork.GatewayIPv4 = config.VLanConfig.GatewayIPv4
newNetwork.AllocationPoolV4Start = config.VLanConfig.AllocationPoolV4Start
newNetwork.AllocationPoolV4Start = config.VLanConfig.AllocationPoolV4End
Expand Down
6 changes: 3 additions & 3 deletions network.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type Network struct {
NameserversV4 []string `json:"nameservers_v4,omitempty"`
NameserversV6 []string `json:"nameservers_v6,omitempty"`
VlanID int `json:"vlan_id" validate:"required" schema:"vlan_id"`
HardwareAddr string `json:"hardware_addr,omitempty" schema:"hardware_addr"`
PhysicalInterface string `json:"physical_interface,omitempty" schema:"physical_interface"`
GatewayIPv4 string `json:"gateway_ipv4" validate:"required" schema:"gateway_ipv4"`
AllocationPoolV4Start string `json:"allocation_pool_v4_start" validate:"required" schema:"allocation_pool_v4_start"`
AllocationPoolV4End string `json:"allocation_pool_v4_end" validate:"required" schema:"allocation_pool_v4_end"`
Expand Down Expand Up @@ -62,8 +62,8 @@ type VLANConnectConfig struct {
// VLanID is the ID of the VLAN to connect to
VlanID int `json:"vlan_id" validate:"required" schema:"vlan_id"`

// HardwareAddr is the base interface(default: eth0) at which we want to setup VLAN.
HardwareAddr string `json:"hardware_addr,omitempty" schema:"hardware_addr"`
// PhysicalInterface is the base interface(default: eth0) at which we want to setup VLAN.
PhysicalInterface string `json:"physical_interface,omitempty" schema:"physical_interface"`

// CIDRv4 is the CIDR of the VLAN to connect to
CIDRv4 string `json:"cidr_v4" validate:"required" schema:"cidr_v4"`
Expand Down
2 changes: 1 addition & 1 deletion network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func TestCreateNetworkWithVLAN(t *testing.T) {

vlanConnectConfig := VLANConnectConfig{
VlanID: 1,
HardwareAddr: "ETH0",
PhysicalInterface: "ETH0",
CIDRv4: "10.0.0.0/24",
GatewayIPv4: "10.0.0.4",
AllocationPoolV4Start: "10.0.0.0",
Expand Down
Loading