當前位置: 首頁>>代碼示例>>Golang>>正文


Golang lastditch.ImageManifest類代碼示例

本文整理匯總了Golang中github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/spec/schema/lastditch.ImageManifest的典型用法代碼示例。如果您正苦於以下問題:Golang ImageManifest類的具體用法?Golang ImageManifest怎麽用?Golang ImageManifest使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ImageManifest類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: newImgListLoadError

func newImgListLoadError(err error, imj []byte, blobKey string) error {
	var lines []string
	im := lastditch.ImageManifest{}
	imErr := im.UnmarshalJSON(imj)
	if imErr == nil {
		lines = append(lines, fmt.Sprintf("Unable to load manifest of image %s (spec version %s) because it is invalid:", im.Name, im.ACVersion))
		lines = append(lines, fmt.Sprintf("  %v", err))
	} else {
		lines = append(lines, "Unable to load manifest of an image because it is invalid:")
		lines = append(lines, fmt.Sprintf("  %v", err))
		lines = append(lines, "  Also, failed to get any information about invalid image manifest:")
		lines = append(lines, fmt.Sprintf("    %v", imErr))
	}
	lines = append(lines, "ID of the invalid image:")
	lines = append(lines, fmt.Sprintf("  %s", blobKey))
	return fmt.Errorf("%s", strings.Join(lines, "\n"))
}
開發者ID:kinpro,項目名稱:rkt,代碼行數:17,代碼來源:image_list.go

示例2: newPodListImageLoadFailure

func newPodListImageLoadFailure(p *pod, err error, pm *schema.PodManifest, imj []byte, app schema.RuntimeApp) error {
	im := lastditch.ImageManifest{}
	imErr := im.UnmarshalJSON(imj)
	acVersion := "unknown"
	if imErr == nil {
		acVersion = im.ACVersion
	}
	lines := []string{
		fmt.Sprintf("Unable to load image %s manifest (spec version %s) because it is invalid:", app.Image.ID.String(), acVersion),
		fmt.Sprintf("  %v", err),
	}
	if imErr != nil {
		lines = append(lines, "  Also, failed to get any information about invalid image manifest:")
		lines = append(lines, fmt.Sprintf("    %v", imErr))
	}
	lines = append(lines, "Objects related to this error:")
	lines = append(lines, fmt.Sprintf("  App: %q from failing image %q (%s)",
		app.Name, app.Image.Name, app.Image.ID))
	lines = append(lines, fmt.Sprintf("  Pod %s (spec version %s) with following apps:", p.uuid.String(), pm.ACVersion.String()))
	for _, pApp := range pm.Apps {
		lines = append(lines, fmt.Sprintf("    %s", appLine(degradeRuntimeApp(pApp))))
	}
	return fmt.Errorf("%s", strings.Join(lines, "\n"))
}
開發者ID:derekparker,項目名稱:rkt,代碼行數:24,代碼來源:list.go


注:本文中的github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/spec/schema/lastditch.ImageManifest類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。