fix(k8s/application): fix an issue with the auto-scaler section
parent
52bdcf2e2b
commit
83c3f9ed06
|
@ -2,14 +2,18 @@ import * as _ from 'lodash-es';
|
||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
import PortainerError from 'Portainer/error';
|
import PortainerError from 'Portainer/error';
|
||||||
|
|
||||||
import { KubernetesApplicationTypes, KubernetesApplicationPublishingTypes } from 'Kubernetes/models/application/models';
|
import {
|
||||||
|
KubernetesApplication,
|
||||||
|
KubernetesApplicationDeploymentTypes,
|
||||||
|
KubernetesApplicationPublishingTypes,
|
||||||
|
KubernetesApplicationTypes,
|
||||||
|
} from 'Kubernetes/models/application/models';
|
||||||
import KubernetesApplicationHelper from 'Kubernetes/helpers/application';
|
import KubernetesApplicationHelper from 'Kubernetes/helpers/application';
|
||||||
import KubernetesApplicationRollbackHelper from 'Kubernetes/helpers/application/rollback';
|
import KubernetesApplicationRollbackHelper from 'Kubernetes/helpers/application/rollback';
|
||||||
import KubernetesApplicationConverter from 'Kubernetes/converters/application';
|
import KubernetesApplicationConverter from 'Kubernetes/converters/application';
|
||||||
import { KubernetesDeployment } from 'Kubernetes/models/deployment/models';
|
import { KubernetesDeployment } from 'Kubernetes/models/deployment/models';
|
||||||
import { KubernetesStatefulSet } from 'Kubernetes/models/stateful-set/models';
|
import { KubernetesStatefulSet } from 'Kubernetes/models/stateful-set/models';
|
||||||
import { KubernetesDaemonSet } from 'Kubernetes/models/daemon-set/models';
|
import { KubernetesDaemonSet } from 'Kubernetes/models/daemon-set/models';
|
||||||
import { KubernetesApplication } from 'Kubernetes/models/application/models';
|
|
||||||
import KubernetesServiceHelper from 'Kubernetes/helpers/serviceHelper';
|
import KubernetesServiceHelper from 'Kubernetes/helpers/serviceHelper';
|
||||||
import { KubernetesHorizontalPodAutoScalerHelper } from 'Kubernetes/horizontal-pod-auto-scaler/helper';
|
import { KubernetesHorizontalPodAutoScalerHelper } from 'Kubernetes/horizontal-pod-auto-scaler/helper';
|
||||||
import { KubernetesHorizontalPodAutoScalerConverter } from 'Kubernetes/horizontal-pod-auto-scaler/converter';
|
import { KubernetesHorizontalPodAutoScalerConverter } from 'Kubernetes/horizontal-pod-auto-scaler/converter';
|
||||||
|
@ -226,7 +230,7 @@ class KubernetesApplicationService {
|
||||||
await Promise.all(_.without(claimPromises, undefined));
|
await Promise.all(_.without(claimPromises, undefined));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (formValues.AutoScaler.IsUsed) {
|
if (formValues.AutoScaler.IsUsed && formValues.DeploymentType !== KubernetesApplicationDeploymentTypes.GLOBAL) {
|
||||||
const kind = KubernetesHorizontalPodAutoScalerHelper.getApplicationTypeString(app);
|
const kind = KubernetesHorizontalPodAutoScalerHelper.getApplicationTypeString(app);
|
||||||
const autoScaler = KubernetesHorizontalPodAutoScalerConverter.applicationFormValuesToModel(formValues, kind);
|
const autoScaler = KubernetesHorizontalPodAutoScalerConverter.applicationFormValuesToModel(formValues, kind);
|
||||||
await this.KubernetesHorizontalPodAutoScalerService.create(autoScaler);
|
await this.KubernetesHorizontalPodAutoScalerService.create(autoScaler);
|
||||||
|
|
|
@ -252,7 +252,9 @@
|
||||||
>
|
>
|
||||||
<i class="fa fa-undo" aria-hidden="true"></i> Auto
|
<i class="fa fa-undo" aria-hidden="true"></i> Auto
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-sm btn-danger" type="button" ng-click="ctrl.removeConfiguration(index)" ng-if="ctrl.formValues.Containers.length <= 1"> <i class="fa fa-trash-alt" aria-hidden="true"></i> Remove </button>
|
<button class="btn btn-sm btn-danger" type="button" ng-click="ctrl.removeConfiguration(index)" ng-if="ctrl.formValues.Containers.length <= 1">
|
||||||
|
<i class="fa fa-trash-alt" aria-hidden="true"></i> Remove
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<!-- no-override -->
|
<!-- no-override -->
|
||||||
<div class="col-sm-12" style="margin-top: 10px;" ng-if="config.SelectedConfiguration && !config.Overriden">
|
<div class="col-sm-12" style="margin-top: 10px;" ng-if="config.SelectedConfiguration && !config.Overriden">
|
||||||
|
@ -845,7 +847,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-inline" ng-if="ctrl.formValues.AutoScaler.IsUsed">
|
<div class="form-inline" ng-if="ctrl.formValues.DeploymentType !== ctrl.ApplicationDeploymentTypes.GLOBAL && ctrl.formValues.AutoScaler.IsUsed">
|
||||||
<table class="table" style="margin-bottom: 0px;">
|
<table class="table" style="margin-bottom: 0px;">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr class="small">
|
<tr class="small">
|
||||||
|
|
Loading…
Reference in New Issue