From 5dad75fbe9fd15cfa7bfa69c046b851ea905876f Mon Sep 17 00:00:00 2001 From: Matthis Holleville Date: Fri, 31 Mar 2023 19:47:10 +0200 Subject: [PATCH] feat: check if ScaleTargetRef is possible option Signed-off-by: Matthis Holleville --- pkg/analyzer/hpaAnalyzer.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/analyzer/hpaAnalyzer.go b/pkg/analyzer/hpaAnalyzer.go index ac66293274..eb409f4b54 100644 --- a/pkg/analyzer/hpaAnalyzer.go +++ b/pkg/analyzer/hpaAnalyzer.go @@ -48,6 +48,8 @@ func AnalyzeHpa(ctx context.Context, config *AnalysisConfiguration, client *kube if err != nil { scaleTargetRefNotFound = true } + default: + failures = append(failures, fmt.Sprintf("HorizontalPodAutoscaler uses %s as ScaleTargetRef which does not possible option.", scaleTargetRef.Kind)) } if scaleTargetRefNotFound {