Beispiel #1
0
func getPodManifest(args []string) (*schema.PodManifest, error) {
	if err := acutil.ParseApps(thePodManifest, args); err != nil {
		return nil, errors.Trace(err)
	} else if acutil.IsPodManifestEmpty(thePodManifest) {
		return nil, ErrUsage
	} else if pm, err := Host.ReifyPodManifest(thePodManifest); err != nil {
		return nil, errors.Trace(err)
	} else {
		return pm, nil
	}
}
Beispiel #2
0
func cmdDotM(args []string) error {
	// 1. Check if UUID
	// 2. Try to construct a new manifest

	if err := acutil.ParseApps(thePodManifest, args); err != nil {
		return errors.Trace(err)
	}

	for i, app := range thePodManifest.Apps {
		// fmt.Println(app.Image.ID, app.Image.ID.Empty())
		if app.Image.ID.Empty() {
			// app is a copy; we need to use index to write
			thePodManifest.Apps[i].Image.ID.Set("sha512-0")
		}
	}

	if mb, err := json.MarshalIndent(thePodManifest, "", "  "); err != nil {
		return errors.Trace(err)
	} else {
		fmt.Println(string(mb))
	}
	return nil
}