Skip to content

Commit

Permalink
Remove string formatting from log message and update names of arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Jul 24, 2023
1 parent 434cfe2 commit 076ba07
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/cloud/services/compute/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (s *Service) normalizePortTarget(port *infrav1.PortOpts, openStackCluster *
// No network, but fixed IPs are defined(we handled the no fixed
// IPs case above): try to infer network from a subnet
if noNetwork {
s.scope.Logger().V(4).Info("No network defined for port %d, attempting to infer from subnet", portIdx)
s.scope.Logger().V(4).Info("No network defined for port, attempting to infer from subnet", "portIndex", portIdx)

// Look for a unique subnet defined in FixedIPs. If we find one
// we can use it to infer the network ID. We don't need to worry
Expand All @@ -94,7 +94,7 @@ func (s *Service) normalizePortTarget(port *infrav1.PortOpts, openStackCluster *
if err != nil {
// Multiple matches might be ok later when we restrict matches to a single network
if errors.Is(err, networking.ErrMultipleMatches) {
s.scope.Logger().V(4).Info("Can't infer network from subnet %d: %s", i, err)
s.scope.Logger().V(4).Info("Couldn't infer network from subnet","IPIndex", i, "err", err)
continue
}

Expand Down Expand Up @@ -432,7 +432,7 @@ func (s *Service) getOrCreateRootVolume(eventObject runtime.Object, instanceSpec
return nil, fmt.Errorf("exected to find volume %s with size %d; found size %d", name, size, volume.Size)
}

s.scope.Logger().Info("using existing root volume %s", name)
s.scope.Logger().Info("Using existing root volume", "rootVolumeName", name)
return volume, nil
}

Expand Down Expand Up @@ -579,7 +579,7 @@ func (s *Service) DeleteInstance(eventObject runtime.Object, instanceStatus *Ins
return nil
}

s.scope.Logger().Info("deleting dangling root volume %s(%s)", volume.Name, volume.ID)
s.scope.Logger().Info("Deleting dangling root volume", "volumeName", volume.Name, "volumeID", volume.ID)
return s.getVolumeClient().DeleteVolume(volume.ID, volumes.DeleteOpts{})
}

Expand Down

0 comments on commit 076ba07

Please sign in to comment.