Exemple #1
0
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
}
Exemple #2
0
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)
}
Exemple #3
0
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)
}
Exemple #4
0
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)
}