fix: update client API call to use StatefulSet instead of Deployment

Co-authored-by: Dominik Augustin <yeahservice@users.noreply.github.com>
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
This commit is contained in:
HOLLEVILLE Matthis
2023-03-31 19:38:12 +02:00
committed by Matthis Holleville
parent 360387249f
commit 4916fef9d6

View File

@@ -44,7 +44,7 @@ func AnalyzeHpa(ctx context.Context, config *AnalysisConfiguration, client *kube
scaleTargetRefNotFound = true
}
case "StatefulSet":
_, err := client.GetClient().AppsV1().Deployments(config.Namespace).Get(ctx, scaleTargetRef.Name, metav1.GetOptions{})
_, err := client.GetClient().AppsV1().StatefulSets(config.Namespace).Get(ctx, scaleTargetRef.Name, metav1.GetOptions{})
if err != nil {
scaleTargetRefNotFound = true
}