From a2d91ec2f96b202dabd21a392be836c7aba8712e Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Fri, 2 Sep 2016 13:51:49 +1200 Subject: [PATCH] feat(container): do not pass HostConfig when starting a container --- .../container/containerController.js | 5 +---- .../containers/containersController.js | 19 ++++--------------- .../createContainerController.js | 4 +--- .../templates/templatesController.js | 4 +--- 4 files changed, 7 insertions(+), 25 deletions(-) diff --git a/app/components/container/containerController.js b/app/components/container/containerController.js index 4d0c2e1a2..21d8ff7e6 100644 --- a/app/components/container/containerController.js +++ b/app/components/container/containerController.js @@ -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) { diff --git a/app/components/containers/containersController.js b/app/components/containers/containersController.js index e64fec4c7..5c40bff7e 100644 --- a/app/components/containers/containersController.js +++ b/app/components/containers/containersController.js @@ -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(); }); } diff --git a/app/components/createContainer/createContainerController.js b/app/components/createContainer/createContainerController.js index 40206ee71..23a98f207 100644 --- a/app/components/createContainer/createContainerController.js +++ b/app/components/createContainer/createContainerController.js @@ -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}); diff --git a/app/components/templates/templatesController.js b/app/components/templates/templatesController.js index 69d7a0e43..112b04c34 100644 --- a/app/components/templates/templatesController.js +++ b/app/components/templates/templatesController.js @@ -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});