Skip to content

Commit ded8c0e

Browse files
almaslennikovnvidia-ci-cd
authored andcommitted
fix: drop unused function from ovs.go
Signed-off-by: Alexander Maslennikov <amaslennikov@nvidia.com>
1 parent 54001c4 commit ded8c0e

File tree

1 file changed

+0
-35
lines changed
  • pkg/host/internal/bridge/ovs

1 file changed

+0
-35
lines changed

pkg/host/internal/bridge/ovs/ovs.go

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626
"strings"
2727
"time"
2828

29-
"github.com/go-logr/logr"
3029
"github.com/google/uuid"
3130
"github.com/ovn-org/libovsdb/client"
3231
"github.com/ovn-org/libovsdb/model"
@@ -211,40 +210,6 @@ func (o *ovs) CreateOVSBridge(ctx context.Context, conf *sriovnetworkv1.OVSConfi
211210
return nil
212211
}
213212

214-
func (o *ovs) ensureInternalInterface(ctx context.Context, funcLog logr.Logger, dbClient client.Client, bridge *BridgeEntry) error {
215-
funcLog.V(2).Info("CreateOVSBridge(): Check if internal interface exists in the bridge")
216-
existingIface, err := o.getInterfaceByName(ctx, dbClient, bridge.Name)
217-
if err != nil {
218-
funcLog.Error(err, "CreateOVSBridge(): failed to check internal interface in the bridge")
219-
return err
220-
}
221-
if existingIface != nil {
222-
// If interface exists but is in error state, we should remove it
223-
if existingIface.Error != nil {
224-
funcLog.V(2).Info("CreateOVSBridge(): internal interface exists but is in error state, removing it", "error", *existingIface.Error)
225-
if err := o.deleteInterfaceByName(ctx, dbClient, bridge.Name); err != nil {
226-
funcLog.Error(err, "CreateOVSBridge(): failed to remove internal interface in error state")
227-
return err
228-
}
229-
existingIface = nil
230-
} else {
231-
funcLog.V(2).Info("CreateOVSBridge(): internal interface already exists and is valid")
232-
return nil // Interface is already in the desired state, return early
233-
}
234-
}
235-
// existingIface is nil here, so we need to create it
236-
funcLog.V(2).Info("CreateOVSBridge(): add internal interface to the bridge")
237-
if err := o.addInterface(ctx, dbClient, bridge, &InterfaceEntry{
238-
Name: bridge.Name,
239-
UUID: uuid.NewString(),
240-
Type: "internal",
241-
}); err != nil {
242-
funcLog.Error(err, "CreateOVSBridge(): failed to add internal interface to the bridge")
243-
return err
244-
}
245-
return nil
246-
}
247-
248213
// GetOVSBridges returns configuration for all managed bridges
249214
func (o *ovs) GetOVSBridges(ctx context.Context) ([]sriovnetworkv1.OVSConfigExt, error) {
250215
ctx, cancel := setDefaultTimeout(ctx)

0 commit comments

Comments
 (0)