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

remove unused function #4877

Merged
merged 1 commit into from
Dec 27, 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
4 changes: 2 additions & 2 deletions pkg/controller/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,10 @@ func (c *Controller) InitIPAM() error {
}
subnetProviderMaps := make(map[string]string, len(subnets))
for _, subnet := range subnets {
subnetProviderMaps[subnet.Name] = subnet.Spec.Provider

klog.Infof("Init subnet %s", subnet.Name)

subnetProviderMaps[subnet.Name] = subnet.Spec.Provider

if err := c.ipam.AddOrUpdateSubnet(subnet.Name, subnet.Spec.CIDRBlock, subnet.Spec.Gateway, subnet.Spec.ExcludeIps); err != nil {
klog.Errorf("failed to init subnet %s: %v", subnet.Name, err)
}
Expand Down
5 changes: 0 additions & 5 deletions pkg/ovs/ovn-nb-dhcp_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,6 @@ func (c *OVNNbClient) ListDHCPOptions(needVendorFilter bool, externalIDs map[str
return dhcpOptList, nil
}

func (c *OVNNbClient) DHCPOptionsExists(lsName, protocol string) (bool, error) {
dhcpOpt, err := c.GetDHCPOptions(lsName, protocol, true)
return dhcpOpt != nil, err
}

// newDHCPOptions return dhcp options with basic information
func newDHCPOptions(lsName, cidr, options string) (*ovnnb.DHCPOptions, error) {
if len(cidr) == 0 || len(lsName) == 0 {
Expand Down
40 changes: 0 additions & 40 deletions pkg/ovs/ovn-nb-dhcp_options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,43 +640,3 @@ func (suite *OvnClientTestSuite) testCreateDHCPOptions() {
require.Error(t, err)
})
}

func (suite *OvnClientTestSuite) testDHCPOptionsExists() {
t := suite.T()
t.Parallel()

nbClient := suite.ovnNBClient
lsName := "test-dhcp-opt-exists-ls"

t.Run("DHCP options exist", func(t *testing.T) {
cidr := "192.168.80.0/24"
err := nbClient.CreateDHCPOptions(lsName, cidr, "")
require.NoError(t, err)

exists, err := nbClient.DHCPOptionsExists(lsName, "IPv4")
require.NoError(t, err)
require.True(t, exists)
})

t.Run("DHCP options do not exist", func(t *testing.T) {
exists, err := nbClient.DHCPOptionsExists(lsName+"-1", "IPv4")
require.NoError(t, err)
require.False(t, exists)
})

t.Run("DHCP options exist for IPv6", func(t *testing.T) {
cidr := "fd00::c0a8:8001/120"
err := nbClient.CreateDHCPOptions(lsName, cidr, "")
require.NoError(t, err)

exists, err := nbClient.DHCPOptionsExists(lsName, "IPv6")
require.NoError(t, err)
require.True(t, exists)
})

t.Run("DHCP options do not exist for IPv6", func(t *testing.T) {
exists, err := nbClient.DHCPOptionsExists(lsName+"-1", "IPv6")
require.NoError(t, err)
require.False(t, exists)
})
}
4 changes: 0 additions & 4 deletions pkg/ovs/ovn-nb-suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -991,10 +991,6 @@ func (suite *OvnClientTestSuite) Test_CreateDHCPOptions() {
suite.testCreateDHCPOptions()
}

func (suite *OvnClientTestSuite) Test_DHCPOptionsExists() {
suite.testDHCPOptionsExists()
}

/* mixed operations unit test */
func (suite *OvnClientTestSuite) Test_CreateGatewayLogicalSwitch() {
suite.testCreateGatewayLogicalSwitch()
Expand Down
Loading