Repository: threefoldtech/zos (go)

Issue:
provisiond: ZDB provision is broken
```
{
    "level": "error",
    "error": "failed to create 0-db container: failed to create container: OCI runtime create failed: container_linux.go:345: starting container process caused \"process_linux.go:430: container init caused \\\"rootfs_linux.go:58: mounting \\\\\\\"proc\\\\\\\" to rootfs \\\\\\\"/var/cache/modules/flistd/mountpoint/278a0299f935ebc5a1ed219e45e67274bf84c50283bb53e439e6629dd5bc775b\\\\\\\" at \\\\\\\"/proc\\\\\\\" caused \\\\\\\"mkdir /var/cache/modules/flistd/mountpoint/278a0299f935ebc5a1ed219e45e67274bf84c50283bb53e439e6629dd5bc775b/proc: read-only file system\\\\\\\"\\\"\": unknown",
    "time": "2019-11-22T08:00:03Z",
    "message": "failed to provision reservation 97-1"
}
```
I'm suspecting this is because we do a read-only mount of the flist now for ZDB container.

Pull request description:
don't mount the root zdb flist as read only
fixes #394

Patch:
diff --git a/pkg/provision/zdb.go b/pkg/provision/zdb.go
index 58c267a3..a87cfb30 100644
--- a/pkg/provision/zdb.go
+++ b/pkg/provision/zdb.go
@@ -220,7 +220,10 @@ func createZdbContainer(ctx context.Context, name string, mode pkg.ZDBMode, volu
 	)
 
 	slog.Debug().Str("flist", zdbFlistURL).Msg("mounting flist")
-	rootFS, err := flist.Mount(zdbFlistURL, "", pkg.ReadOnlyMountOptions)
+	rootFS, err := flist.Mount(zdbFlistURL, "", pkg.MountOptions{
+		Limit:    10,
+		ReadOnly: false,
+	})
 	if err != nil {
 		return nil, err
 	}


Test patch:
diff --git a/pkg/provision/zdb_test.go b/pkg/provision/zdb_test.go
index 7401ef1e..20e9e745 100644
--- a/pkg/provision/zdb_test.go
+++ b/pkg/provision/zdb_test.go
@@ -166,7 +166,10 @@ func TestZDBProvisionNoMappingContainerDoesNotExists(t *testing.T) {
 	client.On("Request", "flist", zbus.ObjectID{Name: "flist", Version: "0.0.1"},
 		"Mount",
 		"https://hub.grid.tf/tf-autobuilder/threefoldtech-0-db-development.flist",
-		"", pkg.ReadOnlyMountOptions).Return("/path/to/volume", nil)
+		"", pkg.MountOptions{
+			Limit:    10,
+			ReadOnly: false,
+		}).Return("/path/to/volume", nil)
 
 	client.On("Request", "network", zbus.ObjectID{Name: "network", Version: "0.0.1"},
 		"ZDBPrepare").Return("net-ns", nil)