Skip to content

Commit

Permalink
address linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
QxBytes committed Sep 6, 2024
1 parent 78cf02a commit 469ef99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 2 additions & 5 deletions dhcp/dhcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,6 @@ func (c *DHCP) receiveDHCPResponse(ctx context.Context, reader io.ReadCloser, xi

select {
case err := <-recvErrors:
if err == unix.EAGAIN {
return errors.Wrap(err, "timed out while listening for replies")
}
if err != nil {
return errors.Wrap(err, "error during receiving")
}
Expand Down Expand Up @@ -411,7 +408,7 @@ func (c *DHCP) DiscoverRequest(ctx context.Context, mac net.HardwareAddr, ifname

defer func() {
// Ensure the file descriptor is closed when done
if err := writer.Close(); err != nil {
if err = writer.Close(); err != nil {
c.logger.Error("Error closing dhcp writer socket:", zap.Error(err))
}
}()
Expand All @@ -429,7 +426,7 @@ func (c *DHCP) DiscoverRequest(ctx context.Context, mac net.HardwareAddr, ifname
}
defer func() {
// Ensure the file descriptor is closed when done
if err := reader.Close(); err != nil {
if err = reader.Close(); err != nil {
c.logger.Error("Error closing dhcp reader socket:", zap.Error(err))
}
}()
Expand Down
3 changes: 2 additions & 1 deletion network/secondary_endpoint_client_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ func (client *SecondaryEndpointClient) ConfigureContainerInterfacesAndRoutes(epI

// issue dhcp discover packet to ensure mapping created for dns via wireserver to work
// we do not use the response for anything
timeout := 3 * time.Second
numSecs := 3
timeout := time.Duration(numSecs) * time.Second
ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(timeout))
defer cancel()
logger.Info("Sending DHCP packet", zap.Any("macAddress", epInfo.MacAddress), zap.String("ifName", epInfo.IfName))
Expand Down

0 comments on commit 469ef99

Please sign in to comment.