improve calling for content

Signed-off-by: yason <yan.xuean@zte.com.cn>
This commit is contained in:
yason
2017-12-11 14:19:30 +08:00
parent c89e555150
commit 41c8763e2b
5 changed files with 29 additions and 36 deletions

View File

@@ -26,7 +26,6 @@ import (
"github.com/containerd/containerd"
"github.com/containerd/containerd/api/services/tasks/v1"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/plugin"
"github.com/containerd/containerd/sys"
@@ -96,8 +95,6 @@ type criContainerdService struct {
snapshotStore *snapshotstore.Store
// taskService is containerd tasks client.
taskService tasks.TasksClient
// contentStoreService is the containerd content service client.
contentStoreService content.Store
// imageStoreService is the containerd service to store and track
// image metadata.
imageStoreService images.Store
@@ -131,20 +128,19 @@ func NewCRIContainerdService(config options.Config) (CRIContainerdService, error
}
c := &criContainerdService{
config: config,
apparmorEnabled: runcapparmor.IsEnabled(),
seccompEnabled: runcseccomp.IsEnabled(),
os: osinterface.RealOS{},
sandboxStore: sandboxstore.NewStore(),
containerStore: containerstore.NewStore(),
imageStore: imagestore.NewStore(),
snapshotStore: snapshotstore.NewStore(),
sandboxNameIndex: registrar.NewRegistrar(),
containerNameIndex: registrar.NewRegistrar(),
taskService: client.TaskService(),
imageStoreService: client.ImageService(),
contentStoreService: client.ContentStore(),
client: client,
config: config,
apparmorEnabled: runcapparmor.IsEnabled(),
seccompEnabled: runcseccomp.IsEnabled(),
os: osinterface.RealOS{},
sandboxStore: sandboxstore.NewStore(),
containerStore: containerstore.NewStore(),
imageStore: imagestore.NewStore(),
snapshotStore: snapshotstore.NewStore(),
sandboxNameIndex: registrar.NewRegistrar(),
containerNameIndex: registrar.NewRegistrar(),
taskService: client.TaskService(),
imageStoreService: client.ImageService(),
client: client,
}
imageFSPath := imageFSPath(config.ContainerdConfig.RootDir, config.ContainerdConfig.Snapshotter)