diff --git a/app/kubernetes/views/applications/create/createApplicationController.js b/app/kubernetes/views/applications/create/createApplicationController.js index 495b151a8..2adcfcd79 100644 --- a/app/kubernetes/views/applications/create/createApplicationController.js +++ b/app/kubernetes/views/applications/create/createApplicationController.js @@ -1178,6 +1178,11 @@ class KubernetesCreateApplicationController { if (this.state.isEdit) { this.nodesLimits.excludesPods(this.application.Pods, this.formValues.CpuLimit, KubernetesResourceReservationHelper.bytesValue(this.formValues.MemoryLimit)); + + // Workaround for EE-6118 + if (this.stack && !this.stack.EndpointId) { + this.stack.EndpointId = this.endpoint.Id; + } } this.oldFormValues = angular.copy(this.formValues); diff --git a/app/portainer/views/stacks/edit/stackController.js b/app/portainer/views/stacks/edit/stackController.js index dd5850471..046aebd26 100644 --- a/app/portainer/views/stacks/edit/stackController.js +++ b/app/portainer/views/stacks/edit/stackController.js @@ -176,7 +176,7 @@ angular.module('portainer.app').controller('StackController', [ // The EndpointID property is not available for these stacks, we can pass // the current endpoint identifier as a part of the migrate request. It will be used if // the EndpointID property is not defined on the stack. - if (stack.EndpointId === 0) { + if (!stack.EndpointId) { stack.EndpointId = endpoint.Id; } @@ -248,7 +248,7 @@ angular.module('portainer.app').controller('StackController', [ // The EndpointID property is not available for these stacks, we can pass // the current endpoint identifier as a part of the update request. It will be used if // the EndpointID property is not defined on the stack. - if (stack.EndpointId === 0) { + if (!stack.EndpointId) { stack.EndpointId = endpoint.Id; } @@ -347,6 +347,11 @@ angular.module('portainer.app').controller('StackController', [ resourcesPromise = stack.Type === 1 ? retrieveSwarmStackResources(stack.Name, agentProxy) : retrieveComposeStackResources(stack.Name); } + // Workaround for EE-6118 + if (!stack.EndpointId) { + stack.EndpointId = endpoint.Id; + } + return $q.all({ stackFile: StackService.getStackFile(id), resources: resourcesPromise,