From 9d67a9d71f2442abf56ef61c81c3b06eefd64817 Mon Sep 17 00:00:00 2001 From: Sunnatillo Date: Mon, 9 Sep 2024 15:28:30 +0300 Subject: [PATCH] Fix log mesages Signed-off-by: Sunnatillo --- baremetal/metal3data_manager.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/baremetal/metal3data_manager.go b/baremetal/metal3data_manager.go index 3636a3208..41fc974f0 100644 --- a/baremetal/metal3data_manager.go +++ b/baremetal/metal3data_manager.go @@ -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 @@ -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 } @@ -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 @@ -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. @@ -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{}