Add image pull waiting.

Signed-off-by: Random-Liu <lantaol@google.com>
This commit is contained in:
Random-Liu
2017-05-22 17:21:17 -07:00
committed by Lantao Liu
parent bc7dfa2650
commit c3ac5f7533
3 changed files with 116 additions and 11 deletions

View File

@@ -29,10 +29,8 @@ import (
rootfsapi "github.com/containerd/containerd/api/services/rootfs"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/rootfs"
contentservice "github.com/containerd/containerd/services/content"
imagesservice "github.com/containerd/containerd/services/images"
rootfsservice "github.com/containerd/containerd/services/rootfs"
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata"
"github.com/kubernetes-incubator/cri-containerd/pkg/metadata/store"
@@ -87,9 +85,8 @@ type criContainerdService struct {
containerService execution.ContainerServiceClient
// contentStoreService is the containerd content service client..
contentStoreService content.Store
// rootfsUnpacker is the containerd service to unpack image content
// into snapshots.
rootfsUnpacker rootfs.Unpacker
// rootfsService is the containerd rootfs service client.
rootfsService rootfsapi.RootFSClient
// imageStoreService is the containerd service to store and track
// image metadata.
imageStoreService images.Store
@@ -99,7 +96,6 @@ type criContainerdService struct {
// NewCRIContainerdService returns a new instance of CRIContainerdService
func NewCRIContainerdService(conn *grpc.ClientConn, rootDir, networkPluginBinDir, networkPluginConfDir string) (CRIContainerdService, error) {
// TODO: Initialize different containerd clients.
// TODO(random-liu): [P2] Recover from runtime state and metadata store.
c := &criContainerdService{
os: osinterface.RealOS{},
@@ -116,7 +112,7 @@ func NewCRIContainerdService(conn *grpc.ClientConn, rootDir, networkPluginBinDir
containerService: execution.NewContainerServiceClient(conn),
imageStoreService: imagesservice.NewStoreFromClient(imagesapi.NewImagesClient(conn)),
contentStoreService: contentservice.NewStoreFromClient(contentapi.NewContentClient(conn)),
rootfsUnpacker: rootfsservice.NewUnpackerFromClient(rootfsapi.NewRootFSClient(conn)),
rootfsService: rootfsapi.NewRootFSClient(conn),
}
netPlugin, err := ocicni.InitCNI(networkPluginBinDir, networkPluginConfDir)