From 8ececad01a65187411045c7937b1bf21e10a2c79 Mon Sep 17 00:00:00 2001 From: Rupak Ganguly Date: Tue, 30 Sep 2014 15:02:08 -0400 Subject: [PATCH] Add support for volumes_from to the apps, templates and services controllers. --- app/controllers/apps_controller.rb | 3 ++- app/controllers/services_controller.rb | 1 + app/controllers/templates_controller.rb | 4 ++-- spec/controllers/templates_controller_spec.rb | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/controllers/apps_controller.rb b/app/controllers/apps_controller.rb index 7d9209e..dfbdaca 100644 --- a/app/controllers/apps_controller.rb +++ b/app/controllers/apps_controller.rb @@ -77,7 +77,8 @@ def app_params environment: [[:variable, :value, :required]], ports: [[:host_interface, :host_port, :container_port, :proto]], expose: [], - volumes: [[:host_path, :container_path]] + volumes: [[:host_path, :container_path]], + volumes_from: [[:service]] ) end diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index 65a72d6..1e13785 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -51,6 +51,7 @@ def service_params(extras=nil) ports: [[:host_interface, :host_port, :container_port, :proto]], expose: [], volumes: [[:host_path, :container_path]], + volumes_from: [[:service_id]], links: [[:service_id, :alias]], environment: [[:variable, :value, :required]] ) diff --git a/app/controllers/templates_controller.rb b/app/controllers/templates_controller.rb index 1ddbe44..1cd7d5d 100644 --- a/app/controllers/templates_controller.rb +++ b/app/controllers/templates_controller.rb @@ -49,8 +49,8 @@ def template_create_params expose: [], links: [[:service_id, :alias]], environment: [[:variable, :value, :required]], - links: [[:service_id, :alias]], - ports: [[:host_interface, :host_port, :container_port, :proto]] + ports: [[:host_interface, :host_port, :container_port, :proto]], + volumes_from: [[:service_id]] ]] ) end diff --git a/spec/controllers/templates_controller_spec.rb b/spec/controllers/templates_controller_spec.rb index edd2253..bd3e406 100644 --- a/spec/controllers/templates_controller_spec.rb +++ b/spec/controllers/templates_controller_spec.rb @@ -43,6 +43,7 @@ { 'variable' => 'GIT_REPO', 'value' => 'https://github.com/fermayo/hello-world-php.git' } ], 'volumes' => [], + 'volumes_from' => [{ 'service_id' => '3' }], 'command' => '/start web' } ]