func RunPods(file string) (RunOutput, error) { var out RunOutput p, err := config.Pods(file) if err != nil { return out, err } script, err := MakeCmd(p) if err != nil { return out, err } cmd := sh.Command{script} fmt.Println(file) fmt.Println(script) fmt.Println("=============================") out = RunOutput{ Pid: p.Id, Pods: file, ContainerId: cmd.Ok(), // ContainerId: cmd.Mock()[0], } return out, nil }
func TestPods(t *testing.T) { yaml, _ := convention.Pods(root) data, err := config.Pods(yaml[0]) if err != nil { t.Fatalf("Err: #v", err) } t.Logf("%#v", data) }
func TestMakeCmd(t *testing.T) { yaml, _ := convention.Pods(root) t.Logf("%#v", yaml) p, _ := config.Pods(yaml[0]) data, err := pods.MakeCmd(p) if err != nil { t.Fatalf("Err: #v", err) } t.Logf("%v", data) }
func TestPods(t *testing.T) { // yaml, _ := convention.Pods(root) yaml := "/etc/docker-pods/maokai.yaml" data, err := config.Pods(yaml) if err != nil { t.Fatalf("Err: #v", err) } t.Logf("%#v", data) t.Logf("%v", data) }