From bd3bbb72f72906313d125ec1771f667c6fe31e38 Mon Sep 17 00:00:00 2001 From: Vishal Anarase Date: Thu, 23 May 2024 15:24:53 +0530 Subject: [PATCH] Rename field HardwareAddr to PhysicalInterface Signed-off-by: Vishal Anarase --- fake_client.go | 2 +- network.go | 6 +++--- network_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fake_client.go b/fake_client.go index 9980c94..6e714a4 100644 --- a/fake_client.go +++ b/fake_client.go @@ -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 diff --git a/network.go b/network.go index ea06946..28f51fe 100644 --- a/network.go +++ b/network.go @@ -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"` @@ -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"` diff --git a/network_test.go b/network_test.go index b45d750..b05aa78 100644 --- a/network_test.go +++ b/network_test.go @@ -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",