Skip to content

Commit e75dda9

Browse files
fix: lint
1 parent 02ff7bc commit e75dda9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

network/endpoint.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ func (nw *network) deleteEndpoint(nl netlink.NetlinkInterface, plc platform.Exec
218218
// Call the platform implementation.
219219
// Pass nil for epClient and will be initialized in deleteEndpointImpl
220220
err = nw.deleteEndpointImpl(nl, plc, nil, nioc, nsc, iptc, dhcpc, ep)
221-
if err == ErrMissingHNSID {
221+
if errors.Is(err, ErrMissingHNSID) {
222222
logger.Info("HNS ID is missing, skipping endpoint deletion")
223223
} else if err != nil {
224224
return err

network/endpoint_windows_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func TestDeleteEndpointImplHnsV2WithEmptyHNSID(t *testing.T) {
136136
mockCli := NewMockEndpointClient(nil)
137137
err := nw.deleteEndpointImpl(netlink.NewMockNetlink(false, ""), platform.NewMockExecClient(false), mockCli,
138138
netio.NewMockNetIO(false, 0), NewMockNamespaceClient(), iptables.NewClient(), &mockDHCP{}, &ep)
139-
if err != ErrMissingHNSID {
139+
if !errors.Is(err, ErrMissingHNSID) {
140140
t.Fatalf("unexpected error when deleting endpoint with empty HNS ID: %v", err)
141141
}
142142
}

network/manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ func (nm *networkManager) DeleteEndpointState(networkID string, epInfo *Endpoint
542542
logger.Info("Deleting endpoint with", zap.String("Endpoint Info: ", epInfo.PrettyString()), zap.String("HNISID : ", ep.HnsId))
543543

544544
err := nw.deleteEndpointImpl(netlink.NewNetlink(), platform.NewExecClient(logger), nil, nil, nil, nil, nil, ep)
545-
if err == ErrMissingHNSID {
545+
if errors.Is(err, ErrMissingHNSID) {
546546
logger.Info("HNS ID is missing, skipping endpoint deletion")
547547
} else if err != nil {
548548
return err

0 commit comments

Comments
 (0)