Migrate HPA v1 to v2beta2 (#2421)
* Migrate HPA v1 to v2beta2 HPA v2beta2 is defined and supported from 1.19+ onwards. Also HPA v2 is stable from 1.23 onwards. As we support 1.19+ onwards using HPA v2beta2. This change is base for custom metrics support we want to add later by modifying Function spec. * Add unit tests for hpa operations * Use constants instead of strings Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
@@ -116,7 +116,7 @@ func (res KubernetesObjectDumper) Dump(dumpDir string) {
|
||||
}
|
||||
|
||||
case KubernetesHPA:
|
||||
objs, err := res.client.AutoscalingV2beta1().HorizontalPodAutoscalers(metav1.NamespaceAll).List(context.TODO(), metav1.ListOptions{LabelSelector: res.selector})
|
||||
objs, err := res.client.AutoscalingV2beta2().HorizontalPodAutoscalers(metav1.NamespaceAll).List(context.TODO(), metav1.ListOptions{LabelSelector: res.selector})
|
||||
if err != nil {
|
||||
console.Error(fmt.Sprintf("Error getting %v list with selector %v: %v", res.objType, res.selector, err))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user