fix(app): get utilization percentage in payload [EE-6387] (#10962)

Co-authored-by: testa113 <testa113>
pull/10964/head
Ali 2024-01-17 08:33:40 +13:00 committed by GitHub
parent 95474b7dc5
commit 752be47fcc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -7,7 +7,7 @@ const _KubernetesHorizontalPodAutoScaler = Object.freeze({
Name: '',
MinReplicas: 1,
MaxReplicas: 1,
TargetCPUUtilization: 0,
targetCpuUtilizationPercentage: 0,
TargetEntity: {
ApiVersion: '',
Kind: '',

View File

@ -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;
});
}