Skip to content

Commit

Permalink
[v2] minor log messages improvements (#758)
Browse files Browse the repository at this point in the history
  • Loading branch information
zroubalik authored Apr 17, 2020
1 parent 18169e9 commit 0881fff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/controller/scaledobject/scaledobject_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (r *ReconcileScaledObject) reconcileScaledObject(logger logr.Logger, scaled
// Create a new HPA or update existing one according to ScaledObject
newHPACreated, err := r.ensureHPAForScaledObjectExists(logger, scaledObject, &gvkr)
if err != nil {
return "Failed to reconcile HPA for ScaledObject", err
return "Failed to ensure HPA is correctly created for ScaledObject", err
}
scaleObjectSpecChanged := false
if !newHPACreated {
Expand All @@ -214,6 +214,8 @@ func (r *ReconcileScaledObject) reconcileScaledObject(logger logr.Logger, scaled
if newHPACreated || scaleObjectSpecChanged {
if r.requestScaleLoop(logger, scaledObject) != nil {
return "Failed to start a new scale loop with scaling logic", err
} else {
logger.Info("Initializing Scaling logic according to ScaledObject Specification")
}
}

Expand Down Expand Up @@ -295,7 +297,7 @@ func (r *ReconcileScaledObject) ensureHPAForScaledObjectExists(logger logr.Logge
// new HPA created successfully -> notify Reconcile function so it could fire a new ScaleLoop
return true, nil
} else if err != nil {
logger.Error(err, "Failed to get HPA")
logger.Error(err, "Failed to get HPA from cluster")
return false, err
}

Expand Down

0 comments on commit 0881fff

Please sign in to comment.