Skip to content

Commit

Permalink
Merge pull request metal3-io#1972 from Nordix/fix-log-messages/sunnat
Browse files Browse the repository at this point in the history
🌱 Fix log mesages
  • Loading branch information
metal3-io-bot committed Sep 16, 2024
2 parents dd95969 + 9d67a9d commit f297895
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions baremetal/metal3data_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ func (m *DataManager) m3IPClaimObjectMeta(name, poolRefName string, preallocatio
// ensureM3IPClaim ensures that a claim for a referenced pool exists.
// It returns the claim and whether to fetch the claim again when fetching IP addresses.
func (m *DataManager) ensureM3IPClaim(ctx context.Context, poolRef corev1.TypedLocalObjectReference) (reconciledClaim, error) {
m.Log.Info("Ensuring M3IPClaim for Metal3Data", "Metal3Data", m.Data.Name)
m.Log.Info("Ensuring Metal3IPClaim for Metal3Data", "Metal3Data", m.Data.Name)
ipClaim, err := fetchM3IPClaim(ctx, m.client, m.Log, m.Data.Name+"-"+poolRef.Name, m.Data.Namespace)
if err == nil {
return reconciledClaim{m3Claim: ipClaim}, nil
Expand Down Expand Up @@ -902,7 +902,6 @@ func (m *DataManager) addressFromClaim(ctx context.Context, _ corev1.TypedLocalO
Gateway: ipamv1.IPAddressStr(address.Spec.Gateway),
dnsServers: []ipamv1.IPAddressStr{},
}
m.Log.Info("allocating", "addr", a)
return a, false, nil
}

Expand Down Expand Up @@ -1271,7 +1270,7 @@ func getLinkMacAddress(mac *infrav1.NetworkLinkEthernetMac,
return "", err
}
if !matching {
return "", fmt.Errorf("bad mac address: %s", macaddress)
return "", fmt.Errorf("bad MAC address: %s", macaddress)
}

return macaddress, nil
Expand Down Expand Up @@ -1386,14 +1385,14 @@ func renderMetaData(m3d *infrav1.Metal3Data, m3dt *infrav1.Metal3DataTemplate,
// getBMHMacByName returns the mac address of the interface matching the name.
func getBMHMacByName(name string, bmh *bmov1alpha1.BareMetalHost) (string, error) {
if bmh == nil || bmh.Status.HardwareDetails == nil || bmh.Status.HardwareDetails.NIC == nil {
return "", errors.New("Nics list not populated")
return "", errors.New("NICs list not populated")
}
for _, nics := range bmh.Status.HardwareDetails.NIC {
if nics.Name == name {
return nics.MAC, nil
}
}
return "", fmt.Errorf("nic name not found %v", name)
return "", fmt.Errorf("NIC name not found %v", name)
}

// getValueFromAnnotation returns an annotation from an object representing a machine.
Expand All @@ -1413,7 +1412,7 @@ func getValueFromAnnotation(object string, annotation string,

func (m *DataManager) getM3Machine(ctx context.Context, m3dt *infrav1.Metal3DataTemplate) (*infrav1.Metal3Machine, error) {
if m.Data.Spec.Claim.Name == "" {
return nil, errors.New("Claim name not set")
return nil, errors.New("Metal3DataClaim name not set")
}

capm3DataClaim := &infrav1.Metal3DataClaim{}
Expand Down

0 comments on commit f297895

Please sign in to comment.