mirror of https://github.com/portainer/portainer
fix(swarm/services): avoid sending credSpec object when empty EE-6178 (#10441)
parent
35dfde70de
commit
da5a4d6714
|
@ -475,7 +475,7 @@ angular.module('portainer.docker').controller('ServiceController', [
|
|||
'';
|
||||
if (oldCredSpecId && !credSpecId) {
|
||||
delete config.TaskTemplate.ContainerSpec.Privileges.CredentialSpec;
|
||||
} else if (oldCredSpecId !== credSpec) {
|
||||
} else if (credSpec && oldCredSpecId !== credSpec) {
|
||||
config.TaskTemplate.ContainerSpec.Privileges = {
|
||||
...(config.TaskTemplate.ContainerSpec.Privileges || {}),
|
||||
CredentialSpec: {
|
||||
|
@ -855,6 +855,10 @@ angular.module('portainer.docker').controller('ServiceController', [
|
|||
|
||||
$scope.filterConfigs = filterConfigs;
|
||||
function filterConfigs(configs) {
|
||||
if (!configs) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return configs.filter((config) => $scope.service.ServiceConfigs.every((serviceConfig) => config.Id !== serviceConfig.Id));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue