From 752be47fccf7fdbd33dcd2fb77b0e76fca187361 Mon Sep 17 00:00:00 2001 From: Ali <83188384+testA113@users.noreply.github.com> Date: Wed, 17 Jan 2024 08:33:40 +1300 Subject: [PATCH] fix(app): get utilization percentage in payload [EE-6387] (#10962) Co-authored-by: testa113 --- app/kubernetes/horizontal-pod-auto-scaler/converter.js | 2 +- app/kubernetes/horizontal-pod-auto-scaler/models.js | 2 +- .../views/applications/create/createApplicationController.js | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/kubernetes/horizontal-pod-auto-scaler/converter.js b/app/kubernetes/horizontal-pod-auto-scaler/converter.js index 12841b0bf..2647cdd79 100644 --- a/app/kubernetes/horizontal-pod-auto-scaler/converter.js +++ b/app/kubernetes/horizontal-pod-auto-scaler/converter.js @@ -50,7 +50,7 @@ export class KubernetesHorizontalPodAutoScalerConverter { res.Namespace = formValues.ResourcePool.Namespace.Name; res.MinReplicas = formValues.AutoScaler.minReplicas; res.MaxReplicas = formValues.AutoScaler.maxReplicas; - res.TargetCPUUtilization = formValues.AutoScaler.targetCpuUtilizationPercentage; + res.targetCpuUtilizationPercentage = formValues.AutoScaler.targetCpuUtilizationPercentage; res.TargetEntity.Name = formValues.Name; res.TargetEntity.Kind = kind; res.TargetEntity.ApiVersion = formValues.AutoScaler.apiVersion; diff --git a/app/kubernetes/horizontal-pod-auto-scaler/models.js b/app/kubernetes/horizontal-pod-auto-scaler/models.js index 1e4bf9122..05061830f 100644 --- a/app/kubernetes/horizontal-pod-auto-scaler/models.js +++ b/app/kubernetes/horizontal-pod-auto-scaler/models.js @@ -7,7 +7,7 @@ const _KubernetesHorizontalPodAutoScaler = Object.freeze({ Name: '', MinReplicas: 1, MaxReplicas: 1, - TargetCPUUtilization: 0, + targetCpuUtilizationPercentage: 0, TargetEntity: { ApiVersion: '', Kind: '', diff --git a/app/kubernetes/views/applications/create/createApplicationController.js b/app/kubernetes/views/applications/create/createApplicationController.js index 0baa7971e..9db29fb5d 100644 --- a/app/kubernetes/views/applications/create/createApplicationController.js +++ b/app/kubernetes/views/applications/create/createApplicationController.js @@ -283,6 +283,7 @@ class KubernetesCreateApplicationController { /* #region AUTO SCALER UI MANAGEMENT */ onAutoScaleChange(values) { return this.$async(async () => { + // when enabling the auto scaler, set the default values if (!this.formValues.AutoScaler.isUsed && values.isUsed) { this.formValues.AutoScaler = { isUsed: values.isUsed, @@ -292,6 +293,7 @@ class KubernetesCreateApplicationController { }; return; } + // otherwise, just update the values this.formValues.AutoScaler = values; }); }