feat(container): do not pass HostConfig when starting a container

pull/184/head
Anthony Lapenna 2016-09-02 13:51:49 +12:00
parent d93a69df95
commit a2d91ec2f9
4 changed files with 7 additions and 25 deletions

View File

@ -46,10 +46,7 @@ function ($scope, $state, $stateParams, $filter, Container, ContainerCommit, Ima
$scope.start = function () {
$('#loadingViewSpinner').show();
Container.start({
id: $scope.container.Id,
HostConfig: $scope.container.HostConfig
}, function (d) {
Container.start({id: $scope.container.Id}, {}, function (d) {
update();
Messages.send("Container started", $stateParams.id);
}, function (e) {

View File

@ -50,22 +50,11 @@ function ($scope, Container, ContainerHelper, Info, Settings, Messages, Config,
if (c.Checked) {
counter = counter + 1;
if (action === Container.start) {
Container.get({id: c.Id}, function (d) {
c = d;
action({id: c.Id, HostConfig: c.HostConfig || {}}, function (d) {
Messages.send("Container " + msg, c.Id);
complete();
}, function (e) {
Messages.error("Failure", e.data);
complete();
});
action({id: c.Id}, {}, function (d) {
Messages.send("Container " + msg, c.Id);
complete();
}, function (e) {
if (e.status === 404) {
$('.detail').hide();
Messages.error("Not found", "Container not found.");
} else {
Messages.error("Failure", e.data);
}
Messages.error("Failure", e.data);
complete();
});
}

View File

@ -87,9 +87,7 @@ function ($scope, $state, Config, Container, Image, Volume, Network, Messages, e
function createContainer(config) {
Container.create(config, function (d) {
if (d.Id) {
var reqBody = config.HostConfig || {};
reqBody.id = d.Id;
Container.start(reqBody, function (cd) {
Container.start({id: d.Id}, {}, function (cd) {
$('#createContainerSpinner').hide();
Messages.send('Container Started', d.Id);
$state.go('containers', {}, {reload: true});

View File

@ -14,9 +14,7 @@ function ($scope, $q, $state, $filter, Config, Container, ContainerHelper, Image
function createContainer(config) {
Container.create(config, function (d) {
if (d.Id) {
var reqBody = config.HostConfig || {};
reqBody.id = d.Id;
Container.start(reqBody, function (cd) {
Container.start({id: d.Id}, {}, function (cd) {
$('#createContainerSpinner').hide();
Messages.send('Container Started', d.Id);
$state.go('containers', {}, {reload: true});