Skip to content

Commit

Permalink
Merge pull request #1242 from aryan9600/fix-hpa-fallback
Browse files Browse the repository at this point in the history
Fix fallback logic for HPAv2 to v2beta2
  • Loading branch information
stefanprodan authored Jul 29, 2022
2 parents 80bae41 + a5c284c commit d4e54fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/canary/hpa_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ func (hr *HPAReconciler) reconcilePrimaryHpa(cd *flaggerv1.Canary, init bool) er
var betaHpa *hpav2beta2.HorizontalPodAutoscaler
hpa, err := hr.kubeClient.AutoscalingV2().HorizontalPodAutoscalers(cd.Namespace).Get(context.TODO(), cd.Spec.AutoscalerRef.Name, metav1.GetOptions{})
if err != nil {
hr.logger.Debugf("v2 HorizontalPodAutoscaler %s.%s get query error: %w; falling back to v2beta2",
hpa = nil
hr.logger.Debugf("v2 HorizontalPodAutoscaler %s.%s get query error: %s; falling back to v2beta2",
cd.Namespace, cd.Spec.AutoscalerRef.Name, err)
var betaErr error
betaHpa, betaErr = hr.kubeClient.AutoscalingV2beta2().HorizontalPodAutoscalers(cd.Namespace).Get(context.TODO(), cd.Spec.AutoscalerRef.Name, metav1.GetOptions{})
Expand Down

0 comments on commit d4e54fe

Please sign in to comment.