Created
March 15, 2017 01:08
-
-
Save sameo/85883581c7271f530d738eccba859bfd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/spec_handlers/mounts.c b/src/spec_handlers/mounts.c | |
index bc172e4..c1362ed 100644 | |
--- a/src/spec_handlers/mounts.c | |
+++ b/src/spec_handlers/mounts.c | |
@@ -20,6 +20,7 @@ | |
#include "spec_handler.h" | |
#include "mount.h" | |
+#include "pod.h" | |
static struct cc_oci_mount* current_mount = NULL; | |
static bool error_detected = false; | |
@@ -161,7 +162,12 @@ handle_mounts_section(GNode* root, struct cc_oci_config* config) { | |
} | |
if (g_strcmp0(root->data, "destination") == 0) { | |
- current_mount->mnt.mnt_dir = g_strdup((gchar*)root->children->data); | |
+ if (! cc_pod_is_vm(config)) { | |
+ g_snprintf(current_mount->mnt.mnt_dir, PATH_MAX, "/%s/rootfs/%s", | |
+ config->optarg_container_id, (gchar*)root->children->data); | |
+ } else { | |
+ current_mount->mnt.mnt_dir = g_strdup((gchar*)root->children->data); | |
+ } | |
} else if (g_strcmp0(root->data, "type") == 0) { | |
current_mount->mnt.mnt_type = g_strdup((gchar*)root->children->data); | |
} else if (g_strcmp0(root->data, "source") == 0) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment