1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 13:29:41 +02:00

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

Co-authored-by: testa113 <testa113>
This commit is contained in:
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.Namespace = formValues.ResourcePool.Namespace.Name;
res.MinReplicas = formValues.AutoScaler.minReplicas; res.MinReplicas = formValues.AutoScaler.minReplicas;
res.MaxReplicas = formValues.AutoScaler.maxReplicas; res.MaxReplicas = formValues.AutoScaler.maxReplicas;
res.TargetCPUUtilization = formValues.AutoScaler.targetCpuUtilizationPercentage; res.targetCpuUtilizationPercentage = formValues.AutoScaler.targetCpuUtilizationPercentage;
res.TargetEntity.Name = formValues.Name; res.TargetEntity.Name = formValues.Name;
res.TargetEntity.Kind = kind; res.TargetEntity.Kind = kind;
res.TargetEntity.ApiVersion = formValues.AutoScaler.apiVersion; res.TargetEntity.ApiVersion = formValues.AutoScaler.apiVersion;

View file

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

View file

@ -283,6 +283,7 @@ class KubernetesCreateApplicationController {
/* #region AUTO SCALER UI MANAGEMENT */ /* #region AUTO SCALER UI MANAGEMENT */
onAutoScaleChange(values) { onAutoScaleChange(values) {
return this.$async(async () => { return this.$async(async () => {
// when enabling the auto scaler, set the default values
if (!this.formValues.AutoScaler.isUsed && values.isUsed) { if (!this.formValues.AutoScaler.isUsed && values.isUsed) {
this.formValues.AutoScaler = { this.formValues.AutoScaler = {
isUsed: values.isUsed, isUsed: values.isUsed,
@ -292,6 +293,7 @@ class KubernetesCreateApplicationController {
}; };
return; return;
} }
// otherwise, just update the values
this.formValues.AutoScaler = values; this.formValues.AutoScaler = values;
}); });
} }