Skip to content

Commit

Permalink
make dhcp client
Browse files Browse the repository at this point in the history
  • Loading branch information
QxBytes committed Sep 10, 2024
1 parent 31bd3ad commit fd3dd25
Show file tree
Hide file tree
Showing 12 changed files with 85 additions and 38 deletions.
3 changes: 2 additions & 1 deletion cni/network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/Azure/azure-container-networking/cns"
cnscli "github.com/Azure/azure-container-networking/cns/client"
"github.com/Azure/azure-container-networking/common"
"github.com/Azure/azure-container-networking/dhcp"
"github.com/Azure/azure-container-networking/iptables"
"github.com/Azure/azure-container-networking/netio"
"github.com/Azure/azure-container-networking/netlink"
Expand Down Expand Up @@ -130,7 +131,7 @@ func NewPlugin(name string,

nl := netlink.NewNetlink()
// Setup network manager.
nm, err := network.NewNetworkManager(nl, platform.NewExecClient(logger), &netio.NetIO{}, network.NewNamespaceClient(), iptables.NewClient())
nm, err := network.NewNetworkManager(nl, platform.NewExecClient(logger), &netio.NetIO{}, network.NewNamespaceClient(), iptables.NewClient(), dhcp.New(logger))
if err != nil {
return nil, err
}
Expand Down
File renamed without changes.
22 changes: 22 additions & 0 deletions dhcp/dhcp_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package dhcp

import (
"context"
"net"

"go.uber.org/zap"
)

type DHCP struct {
logger *zap.Logger
}

func New(logger *zap.Logger) *DHCP {
return &DHCP{
logger: logger,
}
}

func (c *DHCP) DiscoverRequest(_ context.Context, _ net.HardwareAddr, _ string) error {
return nil
}
16 changes: 16 additions & 0 deletions network/dhcp.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package network

import (
"context"
"net"
)

type dhcpClient interface {
DiscoverRequest(context.Context, net.HardwareAddr, string) error
}

type mockDHCP struct{}

func (netns *mockDHCP) DiscoverRequest(context.Context, net.HardwareAddr, string) error {
return nil
}
7 changes: 4 additions & 3 deletions network/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ func (nw *network) newEndpoint(
netioCli netio.NetIOInterface,
nsc NamespaceClientInterface,
iptc ipTablesClient,
dhcpc dhcpClient,
epInfo *EndpointInfo,
) (*endpoint, error) {
var ep *endpoint
Expand All @@ -182,7 +183,7 @@ func (nw *network) newEndpoint(

// Call the platform implementation.
// Pass nil for epClient and will be initialized in newendpointImpl
ep, err = nw.newEndpointImpl(apipaCli, nl, plc, netioCli, nil, nsc, iptc, epInfo)
ep, err = nw.newEndpointImpl(apipaCli, nl, plc, netioCli, nil, nsc, iptc, dhcpc, epInfo)
if err != nil {
return nil, err
}
Expand All @@ -195,7 +196,7 @@ func (nw *network) newEndpoint(

// DeleteEndpoint deletes an existing endpoint from the network.
func (nw *network) deleteEndpoint(nl netlink.NetlinkInterface, plc platform.ExecClient, nioc netio.NetIOInterface, nsc NamespaceClientInterface,
iptc ipTablesClient, endpointID string,
iptc ipTablesClient, dhcpc dhcpClient, endpointID string,
) error {
var err error

Expand All @@ -215,7 +216,7 @@ func (nw *network) deleteEndpoint(nl netlink.NetlinkInterface, plc platform.Exec

// Call the platform implementation.
// Pass nil for epClient and will be initialized in deleteEndpointImpl
err = nw.deleteEndpointImpl(nl, plc, nil, nioc, nsc, iptc, ep)
err = nw.deleteEndpointImpl(nl, plc, nil, nioc, nsc, iptc, dhcpc, ep)
if err != nil {
return err
}
Expand Down
8 changes: 4 additions & 4 deletions network/endpoint_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"strings"

"github.com/Azure/azure-container-networking/cns"
"github.com/Azure/azure-container-networking/dhcp"
"github.com/Azure/azure-container-networking/netio"
"github.com/Azure/azure-container-networking/netlink"
"github.com/Azure/azure-container-networking/network/networkutils"
Expand Down Expand Up @@ -58,6 +57,7 @@ func (nw *network) newEndpointImpl(
testEpClient EndpointClient,
nsc NamespaceClientInterface,
iptc ipTablesClient,
dhcpclient dhcpClient,
epInfo *EndpointInfo,
) (*endpoint, error) {
var (
Expand Down Expand Up @@ -168,7 +168,7 @@ func (nw *network) newEndpointImpl(
epClient = NewLinuxBridgeEndpointClient(nw.extIf, hostIfName, contIfName, nw.Mode, nl, plc)
} else if epInfo.NICType == cns.NodeNetworkInterfaceFrontendNIC {
logger.Info("Secondary client")
epClient = NewSecondaryEndpointClient(nl, netioCli, plc, nsc, dhcp.New(logger), ep)
epClient = NewSecondaryEndpointClient(nl, netioCli, plc, nsc, dhcpclient, ep)
} else {
logger.Info("Transparent client")
epClient = NewTransparentEndpointClient(nw.extIf, hostIfName, contIfName, nw.Mode, nl, netioCli, plc)
Expand Down Expand Up @@ -266,7 +266,7 @@ func (nw *network) newEndpointImpl(

// deleteEndpointImpl deletes an existing endpoint from the network.
func (nw *network) deleteEndpointImpl(nl netlink.NetlinkInterface, plc platform.ExecClient, epClient EndpointClient, nioc netio.NetIOInterface, nsc NamespaceClientInterface,
iptc ipTablesClient, ep *endpoint,
iptc ipTablesClient, dhcpc dhcpClient, ep *endpoint,
) error {
// Delete the veth pair by deleting one of the peer interfaces.
// Deleting the host interface is more convenient since it does not require
Expand All @@ -288,7 +288,7 @@ func (nw *network) deleteEndpointImpl(nl netlink.NetlinkInterface, plc platform.
} else {
// delete if secondary interfaces populated or endpoint of type delegated (new way)
if len(ep.SecondaryInterfaces) > 0 || ep.NICType == cns.NodeNetworkInterfaceFrontendNIC {
epClient = NewSecondaryEndpointClient(nl, nioc, plc, nsc, dhcp.New(logger), ep)
epClient = NewSecondaryEndpointClient(nl, nioc, plc, nsc, dhcpc, ep)
epClient.DeleteEndpointRules(ep)
//nolint:errcheck // ignore error
epClient.DeleteEndpoints(ep)
Expand Down
28 changes: 14 additions & 14 deletions network/endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ var _ = Describe("Test Endpoint", func() {
It("Should be added", func() {
// Add endpoint with valid id
ep, err := nw.newEndpointImpl(nil, netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false),
netio.NewMockNetIO(false, 0), NewMockEndpointClient(nil), NewMockNamespaceClient(), iptables.NewClient(), epInfo)
netio.NewMockNetIO(false, 0), NewMockEndpointClient(nil), NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, epInfo)
Expect(err).NotTo(HaveOccurred())
Expect(ep).NotTo(BeNil())
Expect(ep.Id).To(Equal(epInfo.EndpointID))
Expand All @@ -198,7 +198,7 @@ var _ = Describe("Test Endpoint", func() {
extIf: &externalInterface{IPv4Gateway: net.ParseIP("192.168.0.1")},
}
ep, err := nw2.newEndpointImpl(nil, netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false),
netio.NewMockNetIO(false, 0), NewMockEndpointClient(nil), NewMockNamespaceClient(), iptables.NewClient(), epInfo)
netio.NewMockNetIO(false, 0), NewMockEndpointClient(nil), NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, epInfo)
Expect(err).NotTo(HaveOccurred())
Expect(ep).NotTo(BeNil())
Expect(ep.Id).To(Equal(epInfo.EndpointID))
Expand All @@ -216,7 +216,7 @@ var _ = Describe("Test Endpoint", func() {
Expect(err).ToNot(HaveOccurred())
// Adding endpoint with same id should fail and delete should cleanup the state
ep2, err := nw.newEndpointImpl(nil, netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false),
netio.NewMockNetIO(false, 0), mockCli, NewMockNamespaceClient(), iptables.NewClient(), epInfo)
netio.NewMockNetIO(false, 0), mockCli, NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, epInfo)
Expect(err).To(HaveOccurred())
Expect(ep2).To(BeNil())
assert.Contains(GinkgoT(), err.Error(), "Endpoint already exists")
Expand All @@ -226,17 +226,17 @@ var _ = Describe("Test Endpoint", func() {
// Adding an endpoint with an id.
mockCli := NewMockEndpointClient(nil)
ep2, err := nw.newEndpointImpl(nil, netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false),
netio.NewMockNetIO(false, 0), mockCli, NewMockNamespaceClient(), iptables.NewClient(), epInfo)
netio.NewMockNetIO(false, 0), mockCli, NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, epInfo)
Expect(err).ToNot(HaveOccurred())
Expect(ep2).ToNot(BeNil())
Expect(len(mockCli.endpoints)).To(Equal(1))
// Deleting the endpoint
//nolint:errcheck // ignore error
nw.deleteEndpointImpl(netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false), mockCli, netio.NewMockNetIO(false, 0), NewMockNamespaceClient(), iptables.NewClient(), ep2)
nw.deleteEndpointImpl(netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false), mockCli, netio.NewMockNetIO(false, 0), NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, ep2)
Expect(len(mockCli.endpoints)).To(Equal(0))
// Deleting same endpoint with same id should not fail
//nolint:errcheck // ignore error
nw.deleteEndpointImpl(netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false), mockCli, netio.NewMockNetIO(false, 0), NewMockNamespaceClient(), iptables.NewClient(), ep2)
nw.deleteEndpointImpl(netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false), mockCli, netio.NewMockNetIO(false, 0), NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, ep2)
Expect(len(mockCli.endpoints)).To(Equal(0))
})
})
Expand All @@ -256,7 +256,7 @@ var _ = Describe("Test Endpoint", func() {
extIf: &externalInterface{IPv4Gateway: net.ParseIP("192.168.0.1")},
}
ep, err := nw2.newEndpointImpl(nil, netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false),
netio.NewMockNetIO(false, 0), NewMockEndpointClient(nil), NewMockNamespaceClient(), iptables.NewClient(), epInfo)
netio.NewMockNetIO(false, 0), NewMockEndpointClient(nil), NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, epInfo)
Expect(err).NotTo(HaveOccurred())
Expect(ep).NotTo(BeNil())
Expect(ep.Id).To(Equal(epInfo.EndpointID))
Expand All @@ -282,7 +282,7 @@ var _ = Describe("Test Endpoint", func() {
extIf: &externalInterface{IPv4Gateway: net.ParseIP("192.168.0.1")},
}
ep, err := nw2.newEndpointImpl(nil, netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false),
netio.NewMockNetIO(false, 0), NewMockEndpointClient(nil), NewMockNamespaceClient(), iptables.NewClient(), epInfo)
netio.NewMockNetIO(false, 0), NewMockEndpointClient(nil), NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, epInfo)
Expect(err).NotTo(HaveOccurred())
Expect(ep).NotTo(BeNil())
Expect(ep.Id).To(Equal(epInfo.EndpointID))
Expand All @@ -309,11 +309,11 @@ var _ = Describe("Test Endpoint", func() {
}

return nil
}), NewMockNamespaceClient(), iptables.NewClient(), epInfo)
}), NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, epInfo)
Expect(err).To(HaveOccurred())
Expect(ep).To(BeNil())
ep, err = nw.newEndpointImpl(nil, netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false),
netio.NewMockNetIO(false, 0), NewMockEndpointClient(nil), NewMockNamespaceClient(), iptables.NewClient(), epInfo)
netio.NewMockNetIO(false, 0), NewMockEndpointClient(nil), NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, epInfo)
Expect(err).NotTo(HaveOccurred())
Expect(ep).NotTo(BeNil())
Expect(ep.Id).To(Equal(epInfo.EndpointID))
Expand Down Expand Up @@ -342,27 +342,27 @@ var _ = Describe("Test Endpoint", func() {
It("Should not add endpoint to the network when there is an error", func() {
secondaryEpInfo.MacAddress = netio.BadHwAddr // mock netlink will fail to set link state on bad eth
ep, err := nw.newEndpointImpl(nil, netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false),
netio.NewMockNetIO(false, 0), nil, NewMockNamespaceClient(), iptables.NewClient(), secondaryEpInfo)
netio.NewMockNetIO(false, 0), nil, NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, secondaryEpInfo)
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(Equal("SecondaryEndpointClient Error: " + netlink.ErrorMockNetlink.Error()))
Expect(ep).To(BeNil())
// should not panic or error when going through the unified endpoint impl flow with only the delegated nic type fields
secondaryEpInfo.MacAddress = netio.HwAddr
ep, err = nw.newEndpointImpl(nil, netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false),
netio.NewMockNetIO(false, 0), nil, NewMockNamespaceClient(), iptables.NewClient(), secondaryEpInfo)
netio.NewMockNetIO(false, 0), nil, NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, secondaryEpInfo)
Expect(err).ToNot(HaveOccurred())
Expect(ep.Id).To(Equal(epInfo.EndpointID))
})

It("Should add endpoint when there are no errors", func() {
secondaryEpInfo.MacAddress = netio.HwAddr
ep, err := nw.newEndpointImpl(nil, netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false),
netio.NewMockNetIO(false, 0), nil, NewMockNamespaceClient(), iptables.NewClient(), secondaryEpInfo)
netio.NewMockNetIO(false, 0), nil, NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, secondaryEpInfo)
Expect(err).ToNot(HaveOccurred())
Expect(ep.Id).To(Equal(epInfo.EndpointID))

ep, err = nw.newEndpointImpl(nil, netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false),
netio.NewMockNetIO(false, 0), nil, NewMockNamespaceClient(), iptables.NewClient(), epInfo)
netio.NewMockNetIO(false, 0), nil, NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, epInfo)
Expect(err).ToNot(HaveOccurred())
Expect(ep.Id).To(Equal(epInfo.EndpointID))
})
Expand Down
3 changes: 2 additions & 1 deletion network/endpoint_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ func (nw *network) newEndpointImpl(
_ EndpointClient,
_ NamespaceClientInterface,
_ ipTablesClient,
_ dhcpClient,
epInfo *EndpointInfo,
) (*endpoint, error) {
if epInfo.NICType == cns.BackendNIC {
Expand Down Expand Up @@ -521,7 +522,7 @@ func (nw *network) newEndpointImplHnsV2(cli apipaClient, epInfo *EndpointInfo) (

// deleteEndpointImpl deletes an existing endpoint from the network.
func (nw *network) deleteEndpointImpl(_ netlink.NetlinkInterface, _ platform.ExecClient, _ EndpointClient, _ netio.NetIOInterface, _ NamespaceClientInterface,
_ ipTablesClient, ep *endpoint,
_ ipTablesClient, _ dhcpClient, ep *endpoint,
) error {
// endpoint deletion is not required for IB
if ep.NICType == cns.BackendNIC {
Expand Down
13 changes: 8 additions & 5 deletions network/endpoint_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ func TestDeleteEndpointImplHnsV2ForIB(t *testing.T) {
}

mockCli := NewMockEndpointClient(nil)
err := nw.deleteEndpointImpl(netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false), mockCli, netio.NewMockNetIO(false, 0), NewMockNamespaceClient(), iptables.NewClient(), &ep)
err := nw.deleteEndpointImpl(netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false), mockCli,
netio.NewMockNetIO(false, 0), NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, &ep)
if err != nil {
t.Fatal("endpoint deletion for IB is executed")
}
Expand All @@ -134,7 +135,8 @@ func TestDeleteEndpointImplHnsV2WithEmptyHNSID(t *testing.T) {

// should return nil because HnsID is empty
mockCli := NewMockEndpointClient(nil)
err := nw.deleteEndpointImpl(netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false), mockCli, netio.NewMockNetIO(false, 0), NewMockNamespaceClient(), iptables.NewClient(), &ep)
err := nw.deleteEndpointImpl(netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false), mockCli,
netio.NewMockNetIO(false, 0), NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, &ep)
if err != nil {
t.Fatal("endpoint deletion gets executed")
}
Expand Down Expand Up @@ -492,7 +494,7 @@ func TestNewEndpointImplHnsv2ForIBHappyPath(t *testing.T) {

// Happy Path
endpoint, err := nw.newEndpointImpl(nil, netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false),
netio.NewMockNetIO(false, 0), NewMockEndpointClient(nil), NewMockNamespaceClient(), iptables.NewClient(), epInfo)
netio.NewMockNetIO(false, 0), NewMockEndpointClient(nil), NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, epInfo)

if endpoint != nil || err != nil {
t.Fatalf("Endpoint is created for IB due to %v", err)
Expand Down Expand Up @@ -522,7 +524,7 @@ func TestNewEndpointImplHnsv2ForIBUnHappyPath(t *testing.T) {

// Set UnHappy Path
_, err := nw.newEndpointImpl(nil, netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(true),
netio.NewMockNetIO(false, 0), NewMockEndpointClient(nil), NewMockNamespaceClient(), iptables.NewClient(), epInfo)
netio.NewMockNetIO(false, 0), NewMockEndpointClient(nil), NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, epInfo)

if err == nil {
t.Fatal("Failed to test Endpoint creation for IB with unhappy path")
Expand Down Expand Up @@ -562,7 +564,8 @@ func TestCreateAndDeleteEndpointImplHnsv2ForDelegatedHappyPath(t *testing.T) {
}

mockCli := NewMockEndpointClient(nil)
err = nw.deleteEndpointImpl(netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false), mockCli, netio.NewMockNetIO(false, 0), NewMockNamespaceClient(), iptables.NewClient(), ep)
err = nw.deleteEndpointImpl(netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false), mockCli,
netio.NewMockNetIO(false, 0), NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, ep)
if err != nil {
t.Fatalf("Failed to delete endpoint for Delegated NIC due to %v", err)
}
Expand Down
12 changes: 7 additions & 5 deletions network/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ type networkManager struct {
plClient platform.ExecClient
nsClient NamespaceClientInterface
iptablesClient ipTablesClient
dhcpClient dhcpClient
sync.Mutex
}

Expand Down Expand Up @@ -123,7 +124,7 @@ type NetworkManager interface {

// Creates a new network manager.
func NewNetworkManager(nl netlink.NetlinkInterface, plc platform.ExecClient, netioCli netio.NetIOInterface, nsc NamespaceClientInterface,
iptc ipTablesClient,
iptc ipTablesClient, dhcpc dhcpClient,
) (NetworkManager, error) {
nm := &networkManager{
ExternalInterfaces: make(map[string]*externalInterface),
Expand All @@ -132,6 +133,7 @@ func NewNetworkManager(nl netlink.NetlinkInterface, plc platform.ExecClient, net
netio: netioCli,
nsClient: nsc,
iptablesClient: iptc,
dhcpClient: dhcpc,
}

return nm, nil
Expand Down Expand Up @@ -386,7 +388,7 @@ func (nm *networkManager) createEndpoint(cli apipaClient, networkID string, epIn
}
}

ep, err := nw.newEndpoint(cli, nm.netlink, nm.plClient, nm.netio, nm.nsClient, nm.iptablesClient, epInfo)
ep, err := nw.newEndpoint(cli, nm.netlink, nm.plClient, nm.netio, nm.nsClient, nm.iptablesClient, nm.dhcpClient, epInfo)
if err != nil {
return nil, err
}
Expand All @@ -395,7 +397,7 @@ func (nm *networkManager) createEndpoint(cli apipaClient, networkID string, epIn
if err != nil {
logger.Error("Create endpoint failure", zap.Error(err))
logger.Info("Cleanup resources")
delErr := nw.deleteEndpoint(nm.netlink, nm.plClient, nm.netio, nm.nsClient, nm.iptablesClient, ep.Id)
delErr := nw.deleteEndpoint(nm.netlink, nm.plClient, nm.netio, nm.nsClient, nm.iptablesClient, nm.dhcpClient, ep.Id)
if delErr != nil {
logger.Error("Deleting endpoint after create endpoint failure failed with", zap.Error(delErr))
}
Expand Down Expand Up @@ -489,7 +491,7 @@ func (nm *networkManager) DeleteEndpoint(networkID, endpointID string, epInfo *E
return err
}

err = nw.deleteEndpoint(nm.netlink, nm.plClient, nm.netio, nm.nsClient, nm.iptablesClient, endpointID)
err = nw.deleteEndpoint(nm.netlink, nm.plClient, nm.netio, nm.nsClient, nm.iptablesClient, nm.dhcpClient, endpointID)
if err != nil {
return err
}
Expand Down Expand Up @@ -531,7 +533,7 @@ func (nm *networkManager) DeleteEndpointState(networkID string, epInfo *Endpoint
}
logger.Info("Deleting endpoint with", zap.String("Endpoint Info: ", epInfo.PrettyString()), zap.String("HNISID : ", ep.HnsId))

err := nw.deleteEndpointImpl(netlink.NewNetlink(), platform.NewExecClient(logger), nil, nil, nil, nil, ep)
err := nw.deleteEndpointImpl(netlink.NewNetlink(), platform.NewExecClient(logger), nil, nil, nil, nil, nil, ep)
if err != nil {
return err
}
Expand Down
5 changes: 0 additions & 5 deletions network/secondary_endpoint_client_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package network

import (
"context"
"net"
"os"
"strings"
"time"
Expand All @@ -22,10 +21,6 @@ func newErrorSecondaryEndpointClient(err error) error {
return errors.Wrapf(err, "%s", errorSecondaryEndpointClient)
}

type dhcpClient interface {
DiscoverRequest(context.Context, net.HardwareAddr, string) error
}

type SecondaryEndpointClient struct {
netlink netlink.NetlinkInterface
netioshim netio.NetIOInterface
Expand Down
Loading

0 comments on commit fd3dd25

Please sign in to comment.