Skip to content

Commit

Permalink
wrap in temporary error to retry
Browse files Browse the repository at this point in the history
  • Loading branch information
QxBytes committed Oct 9, 2024
1 parent 524d002 commit e9875e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dhcp/dhcp_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (c *DHCP) verifyIPv4InterfaceAddressCount(ctx context.Context, ifName strin
addressCountErr := retrier.Do(ctx, func() error {
addresses, err := c.getIPv4InterfaceAddresses(ifName)
if err != nil || len(addresses) != count {
return errIncorrectAddressCount
return retry.WrapTemporaryError(errIncorrectAddressCount)

Check failure on line 117 in dhcp/dhcp_windows.go

View workflow job for this annotation

GitHub Actions / Lint (1.21.x, windows-latest)

error returned from external package is unwrapped: sig: func github.com/Azure/azure-container-networking/retry.WrapTemporaryError(err error) error (wrapcheck)

Check failure on line 117 in dhcp/dhcp_windows.go

View workflow job for this annotation

GitHub Actions / Lint (1.22.x, windows-latest)

error returned from external package is unwrapped: sig: func github.com/Azure/azure-container-networking/retry.WrapTemporaryError(err error) error (wrapcheck)
}
return nil
})
Expand Down Expand Up @@ -183,7 +183,7 @@ func (c *DHCP) DiscoverRequest(ctx context.Context, macAddress net.HardwareAddr,
// retry sending the packet until it succeeds
err = retrier.Do(ctx, func() error {
_, sockErr := sock.Write(bytesToSend)
return sockErr
return retry.WrapTemporaryError(sockErr)

Check failure on line 186 in dhcp/dhcp_windows.go

View workflow job for this annotation

GitHub Actions / Lint (1.21.x, windows-latest)

error returned from external package is unwrapped: sig: func github.com/Azure/azure-container-networking/retry.WrapTemporaryError(err error) error (wrapcheck)

Check failure on line 186 in dhcp/dhcp_windows.go

View workflow job for this annotation

GitHub Actions / Lint (1.22.x, windows-latest)

error returned from external package is unwrapped: sig: func github.com/Azure/azure-container-networking/retry.WrapTemporaryError(err error) error (wrapcheck)
})
if err != nil {
return errors.Wrap(err, "failed to write to dhcp socket")
Expand Down

0 comments on commit e9875e5

Please sign in to comment.