server: ensure /var/lib/ocid/images exists
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
fc3b7b5aae
commit
c5d0f23e5a
2 changed files with 10 additions and 3 deletions
|
@ -2,6 +2,7 @@ package server
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/mrunalp/ocid/oci"
|
||||
"github.com/mrunalp/ocid/utils"
|
||||
|
@ -9,6 +10,7 @@ import (
|
|||
|
||||
const (
|
||||
runtimeAPIVersion = "v1alpha1"
|
||||
imageStore = "/var/lib/ocid/images"
|
||||
)
|
||||
|
||||
// Server implements the RuntimeService and ImageService
|
||||
|
@ -26,6 +28,10 @@ func New(runtimePath, sandboxDir, containerDir string) (*Server, error) {
|
|||
return nil, fmt.Errorf("failed to set server as subreaper: %v", err)
|
||||
}
|
||||
|
||||
if err := os.MkdirAll(imageStore, 0755); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
r, err := oci.New(runtimePath, containerDir)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue