container_create: just mkdir on image's volumes

tmpfs'es can override whatever there's on the container rootfs. We just
mkdir the volume as we're confident kube manages volumes in container.
We don't need any tmpfs nor any complex volume handling for now.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2017-06-14 15:23:49 +02:00
parent de0013a2de
commit d2e1d559b7
No known key found for this signature in database
GPG key ID: B2BEAD150DE936B9

View file

@ -588,11 +588,16 @@ func (s *Server) createSandboxContainer(ctx context.Context, containerID string,
} }
// TODO: volume handling in CRI-O // TODO: volume handling in CRI-O
// right now, we do just mount tmpfs in order to have images like // right now, we do just an mkdir in the container rootfs because we
// gcr.io/k8s-testimages/redis:e2e to work with CRI-O // know kube manages volumes its own way and we don't need to behave
// like docker.
// For instance gcr.io/k8s-testimages/redis:e2e now work with CRI-O
for dest := range containerImageConfig.Config.Volumes { for dest := range containerImageConfig.Config.Volumes {
destOptions := []string{"mode=1777", "size=" + strconv.Itoa(64*1024*1024)} fp, err := symlink.FollowSymlinkInScope(filepath.Join(mountPoint, dest), mountPoint)
specgen.AddTmpfsMount(dest, destOptions) if err != nil {
return nil, err
}
os.MkdirAll(fp, 0644)
} }
processArgs, err := buildOCIProcessArgs(containerConfig, containerImageConfig) processArgs, err := buildOCIProcessArgs(containerConfig, containerImageConfig)