Add image load.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2017-10-26 05:59:15 +00:00
parent c6fd18ddc3
commit 25fdf72692
20 changed files with 1316 additions and 104 deletions

View File

@@ -20,6 +20,8 @@ import (
"github.com/golang/glog"
"golang.org/x/net/context"
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
api "github.com/kubernetes-incubator/cri-containerd/pkg/api/v1"
)
// instrumentedService wraps service and logs each operation.
@@ -316,3 +318,15 @@ func (in *instrumentedService) ListContainerStats(ctx context.Context, r *runtim
}()
return in.criContainerdService.ListContainerStats(ctx, r)
}
func (in *instrumentedService) LoadImage(ctx context.Context, r *api.LoadImageRequest) (res *api.LoadImageResponse, err error) {
glog.V(4).Infof("LoadImage from file %q", r.GetFilePath())
defer func() {
if err != nil {
glog.Errorf("LoadImage failed, error: %v", err)
} else {
glog.V(4).Infof("LoadImage returns images %+v", res.GetImages())
}
}()
return in.criContainerdService.LoadImage(ctx, r)
}