1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 14:59:41 +02:00

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

This commit is contained in:
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

View file

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