• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang errors.NewInspectImageError函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/openshift/source-to-image/pkg/errors.NewInspectImageError函数的典型用法代码示例。如果您正苦于以下问题:Golang NewInspectImageError函数的具体用法?Golang NewInspectImageError怎么用?Golang NewInspectImageError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了NewInspectImageError函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: CheckImage

// CheckImage checks image from the local registry.
func (d *stiDocker) CheckImage(name string) (*docker.Image, error) {
	name = getImageName(name)
	image, err := d.client.InspectImage(name)
	if err != nil {
		return nil, errors.NewInspectImageError(name, err)
	}
	return image, nil
}
开发者ID:jhadvig,项目名称:origin,代码行数:9,代码来源:docker.go


示例2: CheckImage

// CheckImage checks image from the local registry.
func (d *stiDocker) CheckImage(name string) (*docker.Image, error) {
	name = getImageName(name)
	image, err := d.client.InspectImage(name)
	if err != nil {
		glog.V(4).Infof("error inspecting image %s: %v", name, err)
		return nil, errors.NewInspectImageError(name, err)
	}
	return image, nil
}
开发者ID:johnmccawley,项目名称:origin,代码行数:10,代码来源:docker.go


示例3: GetLabels

// GetLabels retrieves the labels of the given image.
func (d *stiDocker) GetLabels(name string) (map[string]string, error) {
	name = getImageName(name)
	resp, err := d.InspectImage(name)
	if err != nil {
		glog.V(4).Infof("error inspecting image %s: %v", name, err)
		return nil, errors.NewInspectImageError(name, err)
	}
	return resp.Config.Labels, nil
}
开发者ID:php-coder,项目名称:source-to-image,代码行数:10,代码来源:docker.go


示例4: GetLabels

// GetLabels retrieves the labels of the given image.
func (d *stiDocker) GetLabels(name string) (map[string]string, error) {
	name = getImageName(name)
	image, err := d.client.InspectImage(name)
	if err != nil {
		return nil, errors.NewInspectImageError(name, err)
	}
	return image.Config.Labels, nil

}
开发者ID:urashidmalik,项目名称:origin,代码行数:10,代码来源:docker.go


示例5: GetOnBuild

// GetOnBuild returns the set of ONBUILD Dockerfile commands to execute
// for the given image
func (d *stiDocker) GetOnBuild(name string) ([]string, error) {
	name = getImageName(name)
	resp, err := d.InspectImage(name)
	if err != nil {
		glog.V(4).Infof("error inspecting image %s: %v", name, err)
		return nil, s2ierr.NewInspectImageError(name, err)
	}
	return resp.Config.OnBuild, nil
}
开发者ID:xgwang-zte,项目名称:origin,代码行数:11,代码来源:docker.go


示例6: IsImageInLocalRegistry

// IsImageInLocalRegistry determines whether the supplied image is in the local registry.
func (d *stiDocker) IsImageInLocalRegistry(name string) (bool, error) {
	name = getImageName(name)
	resp, err := d.InspectImage(name)
	if resp != nil {
		return true, nil
	}
	if err != nil && !dockerapi.IsErrImageNotFound(err) {
		return false, errors.NewInspectImageError(name, err)
	}
	return false, nil
}
开发者ID:php-coder,项目名称:source-to-image,代码行数:12,代码来源:docker.go


示例7: GetImageUser

// GetImageUser finds and retrieves the user associated with
// an image if one has been specified
func (d *stiDocker) GetImageUser(name string) (string, error) {
	name = getImageName(name)
	image, err := d.client.InspectImage(name)
	if err != nil {
		return "", errors.NewInspectImageError(name, err)
	}
	user := image.ContainerConfig.User
	if len(user) == 0 {
		user = image.Config.User
	}
	return user, nil
}
开发者ID:jhadvig,项目名称:origin,代码行数:14,代码来源:docker.go


示例8: CheckAndPull

// CheckAndPull pulls an image into the local registry if not present
// and returns the image metadata
func (d *stiDocker) CheckAndPull(name string) (image *docker.Image, err error) {
	name = getImageName(name)
	if image, err = d.client.InspectImage(name); err != nil && err != docker.ErrNoSuchImage {
		return nil, errors.NewInspectImageError(name, err)
	}
	if image == nil {
		return d.PullImage(name)
	}

	glog.V(2).Infof("Image %s available locally", name)
	return
}
开发者ID:yarko,项目名称:source-to-image,代码行数:14,代码来源:docker.go


示例9: PullImage

// PullImage pulls an image into the local registry
func (d *stiDocker) PullImage(name string) (image *docker.Image, err error) {
	name = getImageName(name)
	glog.V(1).Infof("Pulling image %s", name)
	// TODO: Add authentication support
	if err = d.client.PullImage(docker.PullImageOptions{Repository: name}, d.pullAuth); err != nil {
		glog.V(3).Infof("An error was received from the PullImage call: %v", err)
		return nil, errors.NewPullImageError(name, err)
	}
	if image, err = d.client.InspectImage(name); err != nil {
		return nil, errors.NewInspectImageError(name, err)
	}
	return
}
开发者ID:yarko,项目名称:source-to-image,代码行数:14,代码来源:docker.go


示例10: GetImageUser

// GetImageUser finds and retrieves the user associated with
// an image if one has been specified
func (d *stiDocker) GetImageUser(name string) (string, error) {
	name = getImageName(name)
	resp, err := d.InspectImage(name)
	if err != nil {
		glog.V(4).Infof("error inspecting image %s: %v", name, err)
		return "", errors.NewInspectImageError(name, err)
	}
	user := resp.ContainerConfig.User
	if len(user) == 0 {
		user = resp.Config.User
	}
	return user, nil
}
开发者ID:php-coder,项目名称:source-to-image,代码行数:15,代码来源:docker.go


示例11: CheckImage

// CheckImage checks image from the local registry.
func (d *stiDocker) CheckImage(name string) (*api.Image, error) {
	name = getImageName(name)
	inspect, err := d.InspectImage(name)
	if err != nil {
		glog.V(4).Infof("error inspecting image %s: %v", name, err)
		return nil, errors.NewInspectImageError(name, err)
	}
	if inspect != nil {
		image := &api.Image{}
		updateImageWithInspect(image, inspect)
		return image, nil
	}

	return nil, nil
}
开发者ID:php-coder,项目名称:source-to-image,代码行数:16,代码来源:docker.go



注:本文中的github.com/openshift/source-to-image/pkg/errors.NewInspectImageError函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang errors.NewPullImageError函数代码示例发布时间:2022-05-28
下一篇:
Golang errors.NewContainerError函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap