From 1072336bd862693f0f16ade58c4561126e290bf7 Mon Sep 17 00:00:00 2001 From: anak10thn Date: Wed, 4 Jan 2017 17:13:59 +0700 Subject: [PATCH] [ADD] bind volume support #7 --- lib/create.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/create.js b/lib/create.js index 0acd846..75c9ffa 100644 --- a/lib/create.js +++ b/lib/create.js @@ -132,13 +132,22 @@ module.exports = { name.forEach((val,k)=>{ var v = data[val]; /* Add volume type */ + // NFS if(v.type == "nfs"){ if(!v.address || !v.source || !v.target){ - console.log("NFS data not valid!"); + console.log("NFS volume is'n valid!"); process.exit(0); } volumes[name[k]] = "type=volume,volume-opt=o=addr="+v.address+",volume-opt=device=:"+v.source+",volume-opt=type=nfs,source="+name[k]+",target="+v.target; } + // bind + if(v.type == "bind"){ + if(!v.source || !v.target){ + console.log("BIND volume is'n valid!"); + process.exit(0); + } + volumes[name[k]] = "type=bind,src="+v.source+",dst="+v.target; + } }); }, stack : (stack,services)=>{