Esempio n. 1
0
func cmdExec(pod *jetpack.Pod, rtapp types.ACName, args []string) error {
	app := pod.GetApp(rtapp)
	if app == nil {
		return errors.New("CAN'T HAPPEN")
	}
	app.Exec = args
	return errors.Trace(pod.RunApp(rtapp, app))
}
Esempio n. 2
0
func cmdRun(pod *jetpack.Pod) (erv error) {
	if flAppName.Empty() {
		if len(pod.Manifest.Apps) != 1 {
			return errors.New("Multi-app pod! Please use -app=NAME to choose")
		} else {
			flAppName = pod.Manifest.Apps[0].Name
		}
	}
	if flDestroy {
		defer func() {
			if err := pod.Destroy(); err != nil {
				if erv == nil {
					erv = err
				} else {
					// TODO: UI
					fmt.Fprintln(os.Stderr, "ERROR destroying pod:", err)
				}
			}
		}()
	}
	return errors.Trace(pod.RunApp(flAppName, nil))
}
Esempio n. 3
0
func cmdKillPod(pod *jetpack.Pod) error {
	return errors.Trace(pod.Kill())
}
Esempio n. 4
0
func cmdConsole(pod *jetpack.Pod, appName types.ACName) error {
	return errors.Trace(pod.Console(appName, flConsoleUsername))
}
Esempio n. 5
0
func cmdDestroyPod(pod *jetpack.Pod) error {
	return errors.Trace(pod.Destroy())
}