Add container dir to oci

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
Mrunal Patel 2016-08-01 15:08:21 -07:00
parent ac1340488d
commit 764f02ca11
3 changed files with 19 additions and 7 deletions

View file

@ -8,11 +8,12 @@ import (
)
// New creates a new Runtime with options provided
func New(runtimePath string, sandboxDir string) (*Runtime, error) {
func New(runtimePath string, sandboxDir string, containerDir string) (*Runtime, error) {
r := &Runtime{
name: filepath.Base(runtimePath),
path: runtimePath,
sandboxDir: sandboxDir,
name: filepath.Base(runtimePath),
path: runtimePath,
sandboxDir: sandboxDir,
containerDir: containerDir,
}
return r, nil
}
@ -39,6 +40,11 @@ func (r *Runtime) SandboxDir() string {
return r.sandboxDir
}
// ContainerDir returns the path to the base directory for storing container configurations
func (r *Runtime) ContainerDir() string {
return r.containerDir
}
// Version returns the version of the OCI Runtime
func (r *Runtime) Version() (string, error) {
runtimeVersion, err := getOCIVersion(r.path, "-v")