From a80971dd2718df4023ab39e570a179a240579a28 Mon Sep 17 00:00:00 2001 From: Kevan Ahlquist Date: Wed, 28 Jan 2015 02:28:41 -0600 Subject: [PATCH] Implemented RestartPolicy, Devices, and LxcConf. Unified label convention. --- .../startContainerController.js | 8 +- .../startContainerController.spec.js | 8 +- .../startContainer/startcontainer.html | 80 ++++++++++++----- dist/dockerui.js | 90 +++++++++++++------ dist/templates/app.js | 80 ++++++++++++----- 5 files changed, 193 insertions(+), 73 deletions(-) diff --git a/app/components/startContainer/startContainerController.js b/app/components/startContainer/startContainerController.js index c4da4e99b..b7f699d84 100644 --- a/app/components/startContainer/startContainerController.js +++ b/app/components/startContainer/startContainerController.js @@ -21,7 +21,9 @@ function($scope, $routeParams, $location, Container, Messages, containernameFilt DnsSearch: [], VolumesFrom: [], CapAdd: [], - CapDrop: [] + CapDrop: [], + Devices: [], + LxcConf: [] } }; @@ -70,6 +72,10 @@ function($scope, $routeParams, $location, Container, Messages, containernameFilt config.HostConfig.DnsSearch = getNames(config.HostConfig.DnsSearch); config.HostConfig.CapAdd = getNames(config.HostConfig.CapAdd); config.HostConfig.CapDrop = getNames(config.HostConfig.CapDrop); + config.HostConfig.LxcConf = config.HostConfig.LxcConf.reduce(function(prev, cur, idx){ + prev[cur.name] = cur.value; + return prev; + }, {}); var ExposedPorts = {}; var PortBindings = {}; diff --git a/app/components/startContainer/startContainerController.spec.js b/app/components/startContainer/startContainerController.spec.js index 8b51e029a..b8c6f398e 100644 --- a/app/components/startContainer/startContainerController.spec.js +++ b/app/components/startContainer/startContainerController.spec.js @@ -153,7 +153,10 @@ describe('startContainerController', function() { Dns: ['8.8.8.8'], DnsSearch: ['example.com'], CapAdd: ['cap_sys_admin'], - CapDrop: ['cap_foo_bar'] + CapDrop: ['cap_foo_bar'], + Devices: [{ 'PathOnHost': '/dev/deviceName', 'PathInContainer': '/dev/deviceName', 'CgroupPermissions': 'mrw'}], + LxcConf: {'lxc.utsname':'docker'}, + RestartPolicy: {name: 'always', MaximumRetryCount: 5} }, name: 'container-name' }; @@ -185,6 +188,9 @@ describe('startContainerController', function() { scope.config.HostConfig.CapDrop = [{name: 'cap_foo_bar'}]; scope.config.HostConfig.PublishAllPorts = true; scope.config.HostConfig.Privileged = true; + scope.config.HostConfig.RestartPolicy = {name: 'always', MaximumRetryCount: 5}; + scope.config.HostConfig.Devices = [{ 'PathOnHost': '/dev/deviceName', 'PathInContainer': '/dev/deviceName', 'CgroupPermissions': 'mrw'}]; + scope.config.HostConfig.LxcConf = [{name: 'lxc.utsname', value: 'docker'}]; scope.create(); $httpBackend.flush(); diff --git a/app/components/startContainer/startcontainer.html b/app/components/startContainer/startcontainer.html index 309fe03d0..4e5290e6f 100644 --- a/app/components/startContainer/startcontainer.html +++ b/app/components/startContainer/startcontainer.html @@ -54,11 +54,11 @@
- +
- +
@@ -91,7 +91,7 @@
- +
@@ -104,7 +104,7 @@

- +
@@ -120,7 +120,7 @@
- +
@@ -149,14 +149,14 @@
- +
- +
@@ -166,7 +166,7 @@
- +
@@ -176,10 +176,8 @@
- + - -
@@ -188,8 +186,10 @@
- +
+ +
@@ -203,7 +203,7 @@
- +
+
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
+ + + + + + + +
+
+ +
+
+
diff --git a/dist/dockerui.js b/dist/dockerui.js index 847ebbf09..381fc5c10 100644 --- a/dist/dockerui.js +++ b/dist/dockerui.js @@ -1,4 +1,4 @@ -/*! dockerui - v0.6.0 - 2015-01-25 +/*! dockerui - v0.6.0 - 2015-01-28 * https://github.com/crosbymichael/dockerui * Copyright (c) 2015 Michael Crosby; * Licensed MIT @@ -524,7 +524,9 @@ function($scope, $routeParams, $location, Container, Messages, containernameFilt DnsSearch: [], VolumesFrom: [], CapAdd: [], - CapDrop: [] + CapDrop: [], + Devices: [], + LxcConf: [] } }; @@ -573,6 +575,10 @@ function($scope, $routeParams, $location, Container, Messages, containernameFilt config.HostConfig.DnsSearch = getNames(config.HostConfig.DnsSearch); config.HostConfig.CapAdd = getNames(config.HostConfig.CapAdd); config.HostConfig.CapDrop = getNames(config.HostConfig.CapDrop); + config.HostConfig.LxcConf = config.HostConfig.LxcConf.reduce(function(prev, cur, idx){ + prev[cur.name] = cur.value; + return prev; + }, {}); var ExposedPorts = {}; var PortBindings = {}; @@ -1572,11 +1578,11 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t "
\n" + "
\n" + "
\n" + - " \n" + + " \n" + " \n" + "
\n" + "
\n" + - " \n" + + " \n" + " \n" + "
\n" + "
\n" + @@ -1609,7 +1615,7 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t " \n" + "
\n" + "
\n" + - " \n" + + " \n" + "
\n" + "
\n" + " \n" + @@ -1622,7 +1628,7 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t "
\n" + "
\n" + "
\n" + - " \n" + + " \n" + "
\n" + "
\n" + "
\n" + @@ -1638,7 +1644,7 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t "
\n" + "
\n" + "
\n" + - " \n" + + " \n" + "
\n" + " \n" + " \n" + @@ -1667,14 +1673,14 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t " \n" + "
\n" + "
\n" + - " \n" + + " \n" + "
\n" + "
\n" + " \n" + " \n" + "
\n" + "
\n" + - " \n" + + " \n" + "
\n" + "
\n" + " \n" + @@ -1684,7 +1690,7 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t " \n" + "
\n" + "
\n" + - " \n" + + " \n" + "
\n" + "
\n" + " \n" + @@ -1694,10 +1700,8 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t " \n" + "
\n" + "
\n" + - " \n" + + " \n" + "
\n" + - " \n" + - "
\n" + "
\n" + " \n" + "
\n" + @@ -1706,8 +1710,10 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t " \n" + "
\n" + "
\n" + - " \n" + + " \n" + "
\n" + + " \n" + + "
\n" + "
\n" + " \n" + " \n" + @@ -1721,7 +1727,7 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t " \n" + "
\n" + "
\n" + - " \n" + + " \n" + "
\n" + "
\n" + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + "
\n" + + "
\n" + + "
\n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + "
\n" + + "
\n" + + " \n" + "
\n" + "
\n" + " \n" + diff --git a/dist/templates/app.js b/dist/templates/app.js index 008a307e9..0015a9879 100644 --- a/dist/templates/app.js +++ b/dist/templates/app.js @@ -601,11 +601,11 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t "
\n" + "
\n" + "
\n" + - " \n" + + " \n" + " \n" + "
\n" + "
\n" + - " \n" + + " \n" + " \n" + "
\n" + "
\n" + @@ -638,7 +638,7 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t " \n" + "
\n" + "
\n" + - " \n" + + " \n" + "
\n" + "
\n" + " \n" + @@ -651,7 +651,7 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t "
\n" + "
\n" + "
\n" + - " \n" + + " \n" + "
\n" + "
\n" + "
\n" + @@ -667,7 +667,7 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t "
\n" + "
\n" + "
\n" + - " \n" + + " \n" + "
\n" + " \n" + " \n" + @@ -696,14 +696,14 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t " \n" + "
\n" + "
\n" + - " \n" + + " \n" + "
\n" + "
\n" + " \n" + " \n" + "
\n" + "
\n" + - " \n" + + " \n" + "
\n" + "
\n" + " \n" + @@ -713,7 +713,7 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t " \n" + "
\n" + "
\n" + - " \n" + + " \n" + "
\n" + "
\n" + " \n" + @@ -723,10 +723,8 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t " \n" + "
\n" + "
\n" + - " \n" + + " \n" + "
\n" + - " \n" + - "
\n" + "
\n" + " \n" + "
\n" + @@ -735,8 +733,10 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t " \n" + "
\n" + "
\n" + - " \n" + + " \n" + "
\n" + + " \n" + + "
\n" + "
\n" + " \n" + " \n" + @@ -750,7 +750,7 @@ angular.module("app/components/startContainer/startcontainer.html", []).run(["$t " \n" + "
\n" + "
\n" + - " \n" + + " \n" + "
\n" + "
\n" + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + "
\n" + + "
\n" + + "
\n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
\n" + + "
\n" + + " \n" + + "
\n" + + "
\n" + + " \n" + "
\n" + "
\n" + " \n" +