diff --git a/controllers/openstackbaremetalset_controller.go b/controllers/openstackbaremetalset_controller.go index e5d9548e..0a7cc5ff 100644 --- a/controllers/openstackbaremetalset_controller.go +++ b/controllers/openstackbaremetalset_controller.go @@ -1048,7 +1048,7 @@ outer: foundBaremetalHost := &metal3v1alpha1.BareMetalHost{} err = r.Get(ctx, types.NamespacedName{Name: bmh, Namespace: "openshift-machine-api"}, foundBaremetalHost) if err != nil { - cond.Message = fmt.Sprintf("Failed to get %s %s", foundBaremetalHost.Kind, foundBaremetalHost.Name) + cond.Message = fmt.Sprintf("Failed to get %s %s", foundBaremetalHost.Kind, bmh) cond.Reason = shared.BaremetalHostCondReasonGetError cond.Type = shared.CommonCondTypeError @@ -1146,7 +1146,7 @@ func (r *OpenStackBaremetalSetReconciler) baremetalHostDeprovision( baremetalHost := &metal3v1alpha1.BareMetalHost{} err := r.Get(ctx, types.NamespacedName{Name: bmh.HostRef, Namespace: "openshift-machine-api"}, baremetalHost) if err != nil { - cond.Message = fmt.Sprintf("Failed to get %s %s", baremetalHost.Kind, baremetalHost.Name) + cond.Message = fmt.Sprintf("Failed to get %s %s", baremetalHost.Kind, bmh.HostRef) cond.Reason = shared.BaremetalHostCondReasonGetError cond.Type = shared.CommonCondTypeError diff --git a/controllers/openstackclient_controller.go b/controllers/openstackclient_controller.go index d7359fb2..e53c640e 100644 --- a/controllers/openstackclient_controller.go +++ b/controllers/openstackclient_controller.go @@ -745,7 +745,7 @@ func (r *OpenStackClientReconciler) createPVCs( pvc, op, err := common.CreateOrUpdatePvc(ctx, r, instance, &pvcDetails) if err != nil { - cond.Message = fmt.Sprintf("Failed to create or update pvc %s ", pvc.Name) + cond.Message = fmt.Sprintf("Failed to create or update pvc %s ", pvcDetails.Name) cond.Reason = shared.OsClientCondReasonPVCError cond.Type = shared.CommonCondTypeError err = common.WrapErrorForObject(cond.Message, instance, err) @@ -773,7 +773,7 @@ func (r *OpenStackClientReconciler) createPVCs( pvc, op, err = common.CreateOrUpdatePvc(ctx, r, instance, &pvcDetails) if err != nil { - cond.Message = fmt.Sprintf("Failed to create or update pvc %s ", pvc.Name) + cond.Message = fmt.Sprintf("Failed to create or update pvc %s ", pvcDetails.Name) cond.Reason = shared.OsClientCondReasonPVCError cond.Type = shared.CommonCondTypeError err = common.WrapErrorForObject(cond.Message, instance, err) @@ -801,7 +801,7 @@ func (r *OpenStackClientReconciler) createPVCs( pvc, op, err = common.CreateOrUpdatePvc(ctx, r, instance, &pvcDetails) if err != nil { - cond.Message = fmt.Sprintf("Failed to create or update pvc %s ", pvc.Name) + cond.Message = fmt.Sprintf("Failed to create or update pvc %s ", pvcDetails.Name) cond.Reason = shared.OsClientCondReasonPVCError cond.Type = shared.CommonCondTypeError err = common.WrapErrorForObject(cond.Message, instance, err) diff --git a/controllers/openstackipset_controller.go b/controllers/openstackipset_controller.go index f3e88729..e81e45d1 100644 --- a/controllers/openstackipset_controller.go +++ b/controllers/openstackipset_controller.go @@ -246,7 +246,7 @@ func (r *OpenStackIPSetReconciler) Reconcile(ctx context.Context, req ctrl.Reque Namespace: instance.Namespace}, osBms) if err != nil && !k8s_errors.IsNotFound(err) { - cond.Message = fmt.Sprintf("Failed to get %s %s ", osBms.Kind, osBms.Name) + cond.Message = fmt.Sprintf("Failed to get %s %s ", osBms.Kind, instance.Labels[common.OwnerNameLabelSelector]) cond.Reason = shared.BaremetalSetCondReasonError cond.Type = shared.CommonCondTypeError err = common.WrapErrorForObject(cond.Message, instance, err) diff --git a/controllers/openstacknetattachment_controller.go b/controllers/openstacknetattachment_controller.go index 79eb9b5e..5a6681ab 100644 --- a/controllers/openstacknetattachment_controller.go +++ b/controllers/openstacknetattachment_controller.go @@ -386,7 +386,7 @@ func (r *OpenStackNetAttachmentReconciler) getNodeNetworkConfigurationPolicyStat err := r.Get(ctx, types.NamespacedName{Name: instance.Status.BridgeName}, networkConfigurationPolicy) if err != nil { - cond.Message = fmt.Sprintf("Failed to get %s %s ", networkConfigurationPolicy.Kind, networkConfigurationPolicy.Name) + cond.Message = fmt.Sprintf("Failed to get %s %s ", networkConfigurationPolicy.Kind, instance.Status.BridgeName) cond.Reason = shared.CommonCondReasonNNCPError cond.Type = shared.NetAttachError err = common.WrapErrorForObject(cond.Message, instance, err) diff --git a/controllers/openstacknetconfig_controller.go b/controllers/openstacknetconfig_controller.go index 6193358a..02cffb05 100644 --- a/controllers/openstacknetconfig_controller.go +++ b/controllers/openstacknetconfig_controller.go @@ -1235,7 +1235,7 @@ func (r *OpenStackNetConfigReconciler) ensureIPReservation( osClient) if err != nil { if !k8s_errors.IsNotFound(err) { - cond.Message = fmt.Sprintf("Failed to get %s %s ", osClient.Kind, osClient.Name) + cond.Message = fmt.Sprintf("Failed to get %s %s ", osClient.Kind, osIPset.Labels[common.OwnerNameLabelSelector]) cond.Reason = shared.OsClientCondReasonError cond.Type = shared.CommonCondTypeError err = common.WrapErrorForObject(cond.Message, instance, err) diff --git a/pkg/openstackipset/funcs.go b/pkg/openstackipset/funcs.go index 0a161413..a12e8abd 100644 --- a/pkg/openstackipset/funcs.go +++ b/pkg/openstackipset/funcs.go @@ -64,7 +64,7 @@ func EnsureIPs( Namespace: obj.GetNamespace()}, ipSet) if err != nil { - cond.Message = fmt.Sprintf("Failed to get %s %s ", ipSet.Kind, ipSet.Name) + cond.Message = fmt.Sprintf("Failed to get %s %s ", ipSet.Kind, strings.ToLower(name)) cond.Reason = shared.IPSetCondReasonError cond.Type = shared.CommonCondTypeError err = common.WrapErrorForObject(cond.Message, obj, err)