From bb07a968f230347042d1447198c8b1545da2a15b Mon Sep 17 00:00:00 2001 From: timfeirg Date: Tue, 16 May 2017 17:33:16 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=B0=B1=20rw=20=E5=90=A7,?= =?UTF-8?q?=20permdir=20=E5=B0=B1=E6=98=AF=E7=BB=99=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E7=9E=8E=E6=90=9E=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cluster/calcium/helper.go | 2 +- cluster/calcium/helper_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cluster/calcium/helper.go b/cluster/calcium/helper.go index 62a15cdba..9e1567fd7 100644 --- a/cluster/calcium/helper.go +++ b/cluster/calcium/helper.go @@ -91,7 +91,7 @@ func makeMountPaths(specs types.Specs, config types.Config) ([]string, map[strin expanded := os.Expand(path, expandENV) parts := strings.Split(expanded, ":") if len(parts) == 2 { - binds = append(binds, fmt.Sprintf("%s:%s:ro", parts[0], parts[1])) + binds = append(binds, fmt.Sprintf("%s:%s:rw", parts[0], parts[1])) volumes[parts[1]] = struct{}{} } else if len(parts) == 3 { binds = append(binds, fmt.Sprintf("%s:%s:%s", parts[0], parts[1], parts[2])) diff --git a/cluster/calcium/helper_test.go b/cluster/calcium/helper_test.go index 7bd5020e5..1abece42b 100644 --- a/cluster/calcium/helper_test.go +++ b/cluster/calcium/helper_test.go @@ -11,6 +11,6 @@ func TestMakeMountPaths(t *testing.T) { config := types.Config{PermDir: "/mnt/mfs/permdirs", AppDir: "/home"} specs := types.Specs{Appname: "foo", Volumes: []string{"$PERMDIR/foo-data:$APPDIR/foo-data"}} binds, volumes := makeMountPaths(specs, config) - assert.Equal(t, binds, []string{"/mnt/mfs/permdirs/foo/foo-data:/home/foo/foo-data:ro", "/proc/sys:/writable-proc/sys:rw", "/sys/kernel/mm/transparent_hugepage:/writable-sys/kernel/mm/transparent_hugepage:rw"}, "binds should be the same") + assert.Equal(t, binds, []string{"/mnt/mfs/permdirs/foo/foo-data:/home/foo/foo-data:rw", "/proc/sys:/writable-proc/sys:rw", "/sys/kernel/mm/transparent_hugepage:/writable-sys/kernel/mm/transparent_hugepage:rw"}, "binds should be the same") assert.Equal(t, volumes, map[string]struct{}{"/home/foo/foo-data": struct{}{}, "/writable-proc/sys": struct{}{}, "/writable-sys/kernel/mm/transparent_hugepage": struct{}{}}) }