// GetImage gets a single image by name from the double
169368
func (c *CloudAPI) GetImage(imageID string) (*cloudapi.Image, error) {
	if err := c.ProcessFunctionHook(c, imageID); err != nil {
		return nil, err
	}

	for _, image := range c.images {
		if image.Id == imageID {
			return &image, nil
		}
	}

	return nil, fmt.Errorf("Image %s not found", imageID)
}
74871
func (d *dockerCLI) pullImage(name string) error {
	glog.V(4).Infof("docker pull for image %q", name)

	cmd := exec.Command("docker", "pull", name)
	err := cmd.Run()
	if err != nil {
		return fmt.Errorf("error pulling image %q: %v", name, err)
	}

	return nil
}
525057
func (c Client) GetImageStreamImage(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStreamImage, error) {
	return c.ImageStreamImages.ImageStreamImages(apirequest.NamespaceValue(ctx)).Get(name, *options)
}
309980
func (c Client) GetImageStream(ctx context.Context, name string, options *metav1.GetOptions) (*imagev1.ImageStream, error) {
	return c.ImageStreams.ImageStreams(apirequest.NamespaceValue(ctx)).Get(name, *options)
}
141567
func FindImage(repotag string, pull bool) (*Image, error) {
	glog.V(1).Infof("looking up image: %s (pull if neccessary %t)", repotag, pull)
	if pull {
		if err := PullImage(repotag); err != nil && !IsImageNotFound(err) {
			glog.Warningf("Unable to call PullImage: %s", err)
		}
	}
	return lookupImage(repotag)
}
644793
func (c *CheckRunImage) GetImageURL() string {
	if c == nil || c.ImageURL == nil {
		return ""
	}
	return *c.ImageURL
}
606329
func getImageVisibility(visibility string) (*images.ImageVisibility, error) {
	visibilities := [...]images.ImageVisibility{
		images.ImageVisibilityPublic,
		images.ImageVisibilityPrivate,
		images.ImageVisibilityCommunity,
		images.ImageVisibilityShared,
	}

	for _, v := range visibilities {
		if string(v) == visibility {
			return &v, nil
		}
	}

	return nil, fmt.Errorf("Not a valid visibility: %s", visibility)
}
331938
func (f *Facade) GetRegistryImage(ctx datastore.Context, image string) (*registry.Image, error) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.GetRegistryImage"))
	rImage, err := f.registryStore.Get(ctx, image)
	if err != nil {
		return nil, err
	}
	return rImage, nil
}
531306
func (api UsersAPI) GetAvatarImage(w http.ResponseWriter, r *http.Request) {
	hash := mux.Vars(r)["hash"]
	userMgr := user.NewManager(r)
	file, err := userMgr.GetAvatarFile(hash)
	if handleServerError(w, "getting avatar file", err) {
		return
	}
	if file == nil {
		http.Error(w, http.StatusText(http.StatusNotFound), http.StatusNotFound)
		return
	}
	w.WriteHeader(http.StatusOK)
	w.Write(file)
}
539265
func (s *imageReviewLister) Get(name string) (*v1alpha1.ImageReview, error) {
	obj, exists, err := s.indexer.GetByKey(name)
	if err != nil {
		return nil, err
	}
	if !exists {
		return nil, errors.NewNotFound(v1alpha1.Resource("imagereview"), name)
	}
	return obj.(*v1alpha1.ImageReview), nil
}
1223208
func (srv *Server) Get(params imageserver.Params) (*imageserver.Image, error) {
	resp, err := srv.doRequest(params)
	if err != nil {
		return nil, err
	}
	defer func() {
		_ = resp.Body.Close()
	}()
	data, err := loadData(resp)
	if err != nil {
		return nil, err
	}
	format, err := srv.identify(resp, data)
	if err != nil {
		return nil, err
	}
	return &imageserver.Image{
		Format: format,
		Data:   data,
	}, nil
}
144800
func (c *Client) GetImage(imageID string) (*Image, error) {
	var resp Image
	req := request{
		method: client.GET,
		url:    makeURL(apiImages, imageID),
		resp:   &resp,
	}
	if _, err := c.sendRequest(req); err != nil {
		return nil, errors.Newf(err, "failed to get image with id: %s", imageID)
	}
	return &resp, nil
}
1153088
func (api *IconAPI) GetImage(id int64, size string) (*sacloud.Image, error) {

	res := &sacloud.Response{}
	err := api.read(id, map[string]string{"Size": size}, res)
	if err != nil {
		return nil, err
	}
	return res.Image, nil
}
48986
func (dh *Client) DeleteImage(name string) error {
	if name == "" {
		return fmt.Errorf("no image name given")
	}

	req, e := http.NewRequest("DELETE", dh.Address+"/images/"+name, nil)
	if e != nil {
		return e
	}

	resp, e := dh.Client.Do(req)
	if e != nil {
		return e
	}
	defer resp.Body.Close()

	if !success(resp) {
		return fmt.Errorf("failed to delete image %s", name)
	}
	return nil
}
209007
func (client *RegistryIndexClient) FindImage(image string) (*registry.Image, error) {
	image, err := client.parseImage(image)
	if err != nil {
		return nil, err
	}
	rImage, err := client.facade.GetRegistryImage(client.ctx, image)
	if datastore.IsErrNoSuchEntity(err) {
		return nil, ErrImageNotFound
	}
	return rImage, err
}
666276
func (srv *Server) Get(params imageserver.Params) (*imageserver.Image, error) {
	pth, err := srv.getPath(params)
	if err != nil {
		return nil, err
	}
	data, err := loadFile(pth)
	if err != nil {
		return nil, err
	}
	format, err := srv.identify(pth, data)
	if err != nil {
		return nil, err
	}
	return &imageserver.Image{
		Format: format,
		Data:   data,
	}, nil
}
307207
func (f ProviderFunc) Get(params imageserver.Params) (image.Image, error) {
	return f(params)
}