cmd/server: provide a flag to set ocid root dir

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2016-09-21 10:59:37 +02:00
parent a16a4df967
commit 857aaa7816
No known key found for this signature in database
GPG key ID: B2BEAD150DE936B9
3 changed files with 17 additions and 4 deletions

View file

@ -24,6 +24,7 @@ const (
// Server implements the RuntimeService and ImageService
type Server struct {
root string
runtime *oci.Runtime
sandboxDir string
stateLock sync.Mutex
@ -102,7 +103,7 @@ func (s *Server) reservePodName(id, name string) (string, error) {
}
// New creates a new Server with options provided
func New(runtimePath, sandboxDir, containerDir string) (*Server, error) {
func New(runtimePath, root, sandboxDir, containerDir string) (*Server, error) {
// TODO: This will go away later when we have wrapper process or systemd acting as
// subreaper.
if err := utils.SetSubreaper(1); err != nil {
@ -130,6 +131,7 @@ func New(runtimePath, sandboxDir, containerDir string) (*Server, error) {
return nil, err
}
s := &Server{
root: root,
runtime: r,
netPlugin: netPlugin,
sandboxDir: sandboxDir,