From 4d09b7952968aac7cab8ceb6e76f6dc4ff1671eb Mon Sep 17 00:00:00 2001 From: Victor Marmol Date: Wed, 29 Apr 2015 16:00:36 -0700 Subject: [PATCH] Add image-related methods to Runtime interface. This includes RemoveImage() and ListImages(). --- pkg/kubelet/container/runtime.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkg/kubelet/container/runtime.go b/pkg/kubelet/container/runtime.go index c7ea7029cda..207fcc6aa6f 100644 --- a/pkg/kubelet/container/runtime.go +++ b/pkg/kubelet/container/runtime.go @@ -74,6 +74,10 @@ type Runtime interface { PullImage(image string) error // IsImagePresent checks whether the container image is already in the local storage. IsImagePresent(image string) (bool, error) + // Gets all images currently on the machine. + ListImages() ([]Image, error) + // Removes the specified image. + RemoveImage(image string) error // GetContainerLogs returns logs of a specific container. By // default, it returns a snapshot of the container log. Set 'follow' to true to // stream the log. Set 'follow' to false and specify the number of lines (e.g. @@ -154,6 +158,16 @@ type Container struct { Created int64 } +// Basic information about a container image. +type Image struct { + // ID of the image. + ID string + // Other names by which this image is known. + Tags []string + // The size of the image in bytes. + Size int64 +} + // RunContainerOptions specify the options which are necessary for running containers type RunContainerOptions struct { // The environment variables, they are in the form of 'key=value'.