diff --git a/controllers/cluster_controller_phases.go b/controllers/cluster_controller_phases.go index 600f19e15ca5..848d3efffee5 100644 --- a/controllers/cluster_controller_phases.go +++ b/controllers/cluster_controller_phases.go @@ -18,6 +18,7 @@ package controllers import ( "context" + "fmt" "time" "github.com/pkg/errors" @@ -120,7 +121,10 @@ func (r *ClusterReconciler) reconcileExternal(ctx context.Context, cluster *clus cluster.Status.ErrorReason = &clusterStatusError } if errorMessage != "" { - cluster.Status.ErrorMessage = pointer.StringPtr(errorMessage) + cluster.Status.ErrorMessage = pointer.StringPtr( + fmt.Sprintf("Failure detected from referenced resource %v with name %q: %s", + obj.GroupVersionKind(), obj.GetName(), errorMessage), + ) } return obj, nil diff --git a/controllers/machine_controller_phases.go b/controllers/machine_controller_phases.go index 8835b60bf267..bc8e7cbacf3b 100644 --- a/controllers/machine_controller_phases.go +++ b/controllers/machine_controller_phases.go @@ -18,6 +18,7 @@ package controllers import ( "context" + "fmt" "time" "github.com/pkg/errors" @@ -128,7 +129,10 @@ func (r *MachineReconciler) reconcileExternal(ctx context.Context, m *clusterv1. m.Status.ErrorReason = &machineStatusError } if errorMessage != "" { - m.Status.ErrorMessage = pointer.StringPtr(errorMessage) + m.Status.ErrorMessage = pointer.StringPtr( + fmt.Sprintf("Failure detected from referenced resource %v with name %q: %s", + obj.GroupVersionKind(), obj.GetName(), errorMessage), + ) } return obj, nil