fix(application): hpa breaks application edit (#4166)

pull/4169/head
Maxime Bajeux 2020-08-07 00:55:36 +02:00 committed by GitHub
parent 2158cc5157
commit e4ca58a042
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -276,8 +276,10 @@ class KubernetesApplicationService {
const newKind = KubernetesHorizontalPodAutoScalerHelper.getApplicationTypeString(newApp);
const newAutoScaler = KubernetesHorizontalPodAutoScalerConverter.applicationFormValuesToModel(newFormValues, newKind);
if (_.isEmpty(oldFormValues.AutoScaler)) {
await this.KubernetesHorizontalPodAutoScalerService.create(newAutoScaler);
if (!oldFormValues.AutoScaler.IsUsed) {
if (newFormValues.AutoScaler.IsUsed) {
await this.KubernetesHorizontalPodAutoScalerService.create(newAutoScaler);
}
} else {
const oldKind = KubernetesHorizontalPodAutoScalerHelper.getApplicationTypeString(oldApp);
const oldAutoScaler = KubernetesHorizontalPodAutoScalerConverter.applicationFormValuesToModel(oldFormValues, oldKind);