mirror of https://github.com/portainer/portainer
feat(container): do not pass HostConfig when starting a container
parent
d93a69df95
commit
a2d91ec2f9
|
@ -46,10 +46,7 @@ function ($scope, $state, $stateParams, $filter, Container, ContainerCommit, Ima
|
||||||
|
|
||||||
$scope.start = function () {
|
$scope.start = function () {
|
||||||
$('#loadingViewSpinner').show();
|
$('#loadingViewSpinner').show();
|
||||||
Container.start({
|
Container.start({id: $scope.container.Id}, {}, function (d) {
|
||||||
id: $scope.container.Id,
|
|
||||||
HostConfig: $scope.container.HostConfig
|
|
||||||
}, function (d) {
|
|
||||||
update();
|
update();
|
||||||
Messages.send("Container started", $stateParams.id);
|
Messages.send("Container started", $stateParams.id);
|
||||||
}, function (e) {
|
}, function (e) {
|
||||||
|
|
|
@ -50,24 +50,13 @@ function ($scope, Container, ContainerHelper, Info, Settings, Messages, Config,
|
||||||
if (c.Checked) {
|
if (c.Checked) {
|
||||||
counter = counter + 1;
|
counter = counter + 1;
|
||||||
if (action === Container.start) {
|
if (action === Container.start) {
|
||||||
Container.get({id: c.Id}, function (d) {
|
action({id: c.Id}, {}, function (d) {
|
||||||
c = d;
|
|
||||||
action({id: c.Id, HostConfig: c.HostConfig || {}}, function (d) {
|
|
||||||
Messages.send("Container " + msg, c.Id);
|
Messages.send("Container " + msg, c.Id);
|
||||||
complete();
|
complete();
|
||||||
}, function (e) {
|
}, function (e) {
|
||||||
Messages.error("Failure", e.data);
|
Messages.error("Failure", e.data);
|
||||||
complete();
|
complete();
|
||||||
});
|
});
|
||||||
}, function (e) {
|
|
||||||
if (e.status === 404) {
|
|
||||||
$('.detail').hide();
|
|
||||||
Messages.error("Not found", "Container not found.");
|
|
||||||
} else {
|
|
||||||
Messages.error("Failure", e.data);
|
|
||||||
}
|
|
||||||
complete();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
else if (action === Container.remove) {
|
else if (action === Container.remove) {
|
||||||
action({id: c.Id}, function (d) {
|
action({id: c.Id}, function (d) {
|
||||||
|
|
|
@ -87,9 +87,7 @@ function ($scope, $state, Config, Container, Image, Volume, Network, Messages, e
|
||||||
function createContainer(config) {
|
function createContainer(config) {
|
||||||
Container.create(config, function (d) {
|
Container.create(config, function (d) {
|
||||||
if (d.Id) {
|
if (d.Id) {
|
||||||
var reqBody = config.HostConfig || {};
|
Container.start({id: d.Id}, {}, function (cd) {
|
||||||
reqBody.id = d.Id;
|
|
||||||
Container.start(reqBody, function (cd) {
|
|
||||||
$('#createContainerSpinner').hide();
|
$('#createContainerSpinner').hide();
|
||||||
Messages.send('Container Started', d.Id);
|
Messages.send('Container Started', d.Id);
|
||||||
$state.go('containers', {}, {reload: true});
|
$state.go('containers', {}, {reload: true});
|
||||||
|
|
|
@ -14,9 +14,7 @@ function ($scope, $q, $state, $filter, Config, Container, ContainerHelper, Image
|
||||||
function createContainer(config) {
|
function createContainer(config) {
|
||||||
Container.create(config, function (d) {
|
Container.create(config, function (d) {
|
||||||
if (d.Id) {
|
if (d.Id) {
|
||||||
var reqBody = config.HostConfig || {};
|
Container.start({id: d.Id}, {}, function (cd) {
|
||||||
reqBody.id = d.Id;
|
|
||||||
Container.start(reqBody, function (cd) {
|
|
||||||
$('#createContainerSpinner').hide();
|
$('#createContainerSpinner').hide();
|
||||||
Messages.send('Container Started', d.Id);
|
Messages.send('Container Started', d.Id);
|
||||||
$state.go('containers', {}, {reload: true});
|
$state.go('containers', {}, {reload: true});
|
||||||
|
|
Loading…
Reference in New Issue