Compare commits

...

2 Commits

Author SHA1 Message Date
cong meng
1f2a90a722 fix(frontend): When a docker endpoint is selected, configuring a newly added k8s agent fails EE-821 (#5115)
* fix(frontend): When a docker endpoint is selected, configuring a newly added k8s agent fails EE-821

* fix(frontend): restore endpointID in a finally block EE-821

Co-authored-by: Simon Meng <simon.meng@portainer.io>
2021-06-09 21:54:36 +02:00
yi-portainer
1d46f2bb35 * update portainer version to 2.5.1 2021-05-28 10:21:29 +12:00
3 changed files with 25 additions and 13 deletions

View File

@@ -1327,7 +1327,7 @@ type (
const (
// APIVersion is the version number of the Portainer API
APIVersion = "2.5.0"
APIVersion = "2.5.1"
// DBVersion is the version number of the Portainer database
DBVersion = 27
// ComposeSyntaxMaxVersion is a maximum supported version of the docker compose syntax

View File

@@ -139,20 +139,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) => {

View File

@@ -2,7 +2,7 @@
"author": "Portainer.io",
"name": "portainer",
"homepage": "http://portainer.io",
"version": "2.5.0",
"version": "2.5.1",
"repository": {
"type": "git",
"url": "git@github.com:portainer/portainer.git"