* Add docker pullable support.

* Fix inspect image bug.
* Fix remove image bug.
This commit is contained in:
Random-Liu
2016-10-07 21:35:18 -07:00
parent ead65fc25f
commit afa3414779
15 changed files with 166 additions and 38 deletions

View File

@@ -17,7 +17,6 @@ limitations under the License.
package testing
import (
"fmt"
"sync"
runtimeApi "k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
@@ -89,11 +88,7 @@ func (r *FakeImageService) ImageStatus(image *runtimeApi.ImageSpec) (*runtimeApi
r.Called = append(r.Called, "ImageStatus")
if img, ok := r.Images[image.GetImage()]; ok {
return img, nil
}
return nil, fmt.Errorf("image %q not found", image.GetImage())
return r.Images[image.GetImage()], nil
}
func (r *FakeImageService) PullImage(image *runtimeApi.ImageSpec, auth *runtimeApi.AuthConfig) error {

View File

@@ -2963,7 +2963,8 @@ var _RuntimeService_serviceDesc = grpc.ServiceDesc{
type ImageServiceClient interface {
// ListImages lists existing images.
ListImages(ctx context.Context, in *ListImagesRequest, opts ...grpc.CallOption) (*ListImagesResponse, error)
// ImageStatus returns the status of the image.
// ImageStatus returns the status of the image. If the image is not
// present, returns nil.
ImageStatus(ctx context.Context, in *ImageStatusRequest, opts ...grpc.CallOption) (*ImageStatusResponse, error)
// PullImage pulls an image with authentication config.
PullImage(ctx context.Context, in *PullImageRequest, opts ...grpc.CallOption) (*PullImageResponse, error)
@@ -3021,7 +3022,8 @@ func (c *imageServiceClient) RemoveImage(ctx context.Context, in *RemoveImageReq
type ImageServiceServer interface {
// ListImages lists existing images.
ListImages(context.Context, *ListImagesRequest) (*ListImagesResponse, error)
// ImageStatus returns the status of the image.
// ImageStatus returns the status of the image. If the image is not
// present, returns nil.
ImageStatus(context.Context, *ImageStatusRequest) (*ImageStatusResponse, error)
// PullImage pulls an image with authentication config.
PullImage(context.Context, *PullImageRequest) (*PullImageResponse, error)

View File

@@ -46,7 +46,8 @@ service RuntimeService {
service ImageService {
// ListImages lists existing images.
rpc ListImages(ListImagesRequest) returns (ListImagesResponse) {}
// ImageStatus returns the status of the image.
// ImageStatus returns the status of the image. If the image is not
// present, returns nil.
rpc ImageStatus(ImageStatusRequest) returns (ImageStatusResponse) {}
// PullImage pulls an image with authentication config.
rpc PullImage(PullImageRequest) returns (PullImageResponse) {}