5c81217e09
Signed-off-by: Michał Żyłowski <michal.zylowski@intel.com>
29 lines
683 B
Go
29 lines
683 B
Go
package server
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/Sirupsen/logrus"
|
|
"golang.org/x/net/context"
|
|
pb "k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
|
|
)
|
|
|
|
// RemoveImage removes the image.
|
|
func (s *Server) RemoveImage(ctx context.Context, req *pb.RemoveImageRequest) (*pb.RemoveImageResponse, error) {
|
|
logrus.Debugf("RemoveImageRequest: %+v", req)
|
|
image := ""
|
|
img := req.GetImage()
|
|
if img != nil {
|
|
image = img.Image
|
|
}
|
|
if image == "" {
|
|
return nil, fmt.Errorf("no image specified")
|
|
}
|
|
err := s.images.RemoveImage(s.imageContext, image)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
resp := &pb.RemoveImageResponse{}
|
|
logrus.Debugf("RemoveImageResponse: %+v", resp)
|
|
return resp, nil
|
|
}
|