Merge pull request #1151 from fgalind1/improve-logs
logging: improve logs for scaling
This commit is contained in:
		
						commit
						828ddcd44e
					
				| 
						 | 
					@ -351,9 +351,7 @@ func (autoscaler *HorizontalRunnerAutoscalerGitHubWebhook) findHRAsByKey(ctx con
 | 
				
			||||||
			return nil, err
 | 
								return nil, err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		for _, d := range hraList.Items {
 | 
							hras = append(hras, hraList.Items...)
 | 
				
			||||||
			hras = append(hras, d)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return hras, nil
 | 
						return hras, nil
 | 
				
			||||||
| 
						 | 
					@ -797,7 +795,7 @@ func (autoscaler *HorizontalRunnerAutoscalerGitHubWebhook) tryScale(ctx context.
 | 
				
			||||||
	after := len(copy.Spec.CapacityReservations)
 | 
						after := len(copy.Spec.CapacityReservations)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	autoscaler.Log.V(1).Info(
 | 
						autoscaler.Log.V(1).Info(
 | 
				
			||||||
		"Patching hra for capacityReservations update",
 | 
							fmt.Sprintf("Patching hra %s for capacityReservations update", target.HorizontalRunnerAutoscaler.Name),
 | 
				
			||||||
		"before", before,
 | 
							"before", before,
 | 
				
			||||||
		"expired", expired,
 | 
							"expired", expired,
 | 
				
			||||||
		"amount", amount,
 | 
							"amount", amount,
 | 
				
			||||||
| 
						 | 
					@ -837,6 +835,7 @@ func (autoscaler *HorizontalRunnerAutoscalerGitHubWebhook) SetupWithManager(mgr
 | 
				
			||||||
		hra := rawObj.(*v1alpha1.HorizontalRunnerAutoscaler)
 | 
							hra := rawObj.(*v1alpha1.HorizontalRunnerAutoscaler)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if hra.Spec.ScaleTargetRef.Name == "" {
 | 
							if hra.Spec.ScaleTargetRef.Name == "" {
 | 
				
			||||||
 | 
								autoscaler.Log.V(1).Info(fmt.Sprintf("scale target ref name not set for hra %s", hra.Name))
 | 
				
			||||||
			return nil
 | 
								return nil
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -199,7 +199,7 @@ func (r *RunnerReplicaSetReconciler) Reconcile(ctx context.Context, req ctrl.Req
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		n := current - desired
 | 
							n := current - desired
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		log.V(0).Info(fmt.Sprintf("Deleting %d runners", n), "desired", desired, "current", current, "ready", ready)
 | 
							log.V(0).Info(fmt.Sprintf("Deleting %d runners from RunnerReplicaSet %s", n, req.NamespacedName), "desired", desired, "current", current, "ready", ready)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// get runners that are currently offline/not busy/timed-out to register
 | 
							// get runners that are currently offline/not busy/timed-out to register
 | 
				
			||||||
		var deletionCandidates []v1alpha1.Runner
 | 
							var deletionCandidates []v1alpha1.Runner
 | 
				
			||||||
| 
						 | 
					@ -277,7 +277,7 @@ func (r *RunnerReplicaSetReconciler) Reconcile(ctx context.Context, req ctrl.Req
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			r.Recorder.Event(&rs, corev1.EventTypeNormal, "RunnerDeleted", fmt.Sprintf("Deleted runner '%s'", deletionCandidates[i].Name))
 | 
								r.Recorder.Event(&rs, corev1.EventTypeNormal, "RunnerDeleted", fmt.Sprintf("Deleted runner '%s'", deletionCandidates[i].Name))
 | 
				
			||||||
			log.Info("Deleted runner")
 | 
								log.Info(fmt.Sprintf("Deleted runner %s", deletionCandidates[i].Name))
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else if desired > current {
 | 
						} else if desired > current {
 | 
				
			||||||
		n := desired - current
 | 
							n := desired - current
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue