Merge branch 'release/2.5' into develop

pull/5166/head^2
yi-portainer 4 years ago
commit 6a88c2ae36

@ -141,20 +141,32 @@ class KubernetesConfigureController {
}
async removeIngressesAcrossNamespaces() {
const promises = [];
const ingressesToDel = _.filter(this.formValues.IngressClasses, { NeedsDeletion: true });
const allResourcePools = await this.KubernetesResourcePoolService.get();
const resourcePools = _.filter(
allResourcePools,
(resourcePool) =>
!this.KubernetesNamespaceHelper.isSystemNamespace(resourcePool.Namespace.Name) && !this.KubernetesNamespaceHelper.isDefaultNamespace(resourcePool.Namespace.Name)
);
ingressesToDel.forEach((ingress) => {
resourcePools.forEach((resourcePool) => {
promises.push(this.KubernetesIngressService.delete(resourcePool.Namespace.Name, ingress.Name));
if (!ingressesToDel.length) {
return;
}
const promises = [];
const oldEndpointID = this.EndpointProvider.endpointID();
this.EndpointProvider.setEndpointID(this.endpoint.Id);
try {
const allResourcePools = await this.KubernetesResourcePoolService.get();
const resourcePools = _.filter(
allResourcePools,
(resourcePool) =>
!this.KubernetesNamespaceHelper.isSystemNamespace(resourcePool.Namespace.Name) && !this.KubernetesNamespaceHelper.isDefaultNamespace(resourcePool.Namespace.Name)
);
ingressesToDel.forEach((ingress) => {
resourcePools.forEach((resourcePool) => {
promises.push(this.KubernetesIngressService.delete(resourcePool.Namespace.Name, ingress.Name));
});
});
});
} finally {
this.EndpointProvider.setEndpointID(oldEndpointID);
}
const responses = await Promise.allSettled(promises);
responses.forEach((respons) => {

Loading…
Cancel
Save