mirror of
https://github.com/portainer/portainer.git
synced 2025-08-04 21:35:23 +02:00
fix(services): prevent adding volume without source and target (#4538)
* feat(services): check that target mounts are non empty * feat(services): prevent creating service when no source * refactor(services): remove ng-form * fix(services): check that every volume is valid
This commit is contained in:
parent
5f2f7a87ab
commit
067257df2b
5 changed files with 51 additions and 19 deletions
|
@ -378,6 +378,12 @@ angular.module('portainer.docker').controller('ServiceController', [
|
|||
return hasChanges;
|
||||
};
|
||||
|
||||
$scope.mountsAreValid = mountsAreValid;
|
||||
function mountsAreValid() {
|
||||
const mounts = $scope.service.ServiceMounts;
|
||||
return mounts.every((mount) => mount.Source && mount.Target);
|
||||
}
|
||||
|
||||
function buildChanges(service) {
|
||||
var config = ServiceHelper.serviceToConfig(service.Model);
|
||||
config.Name = service.Name;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue