bind filenames var instead of looking up

This commit is contained in:
deads2k
2015-08-14 14:46:43 -04:00
parent 5c2c42eed8
commit f1b81ff678
17 changed files with 169 additions and 87 deletions

View File

@@ -309,7 +309,7 @@ func TestLabelErrors(t *testing.T) {
for k, v := range testCase.flags {
cmd.Flags().Set(k, v)
}
err := RunLabel(f, buf, cmd, testCase.args)
err := RunLabel(f, buf, cmd, testCase.args, &LabelOptions{})
if !testCase.errFn(err) {
t.Errorf("%s: unexpected error: %v", k, err)
continue
@@ -357,9 +357,11 @@ func TestLabelForResourceFromFile(t *testing.T) {
buf := bytes.NewBuffer([]byte{})
cmd := NewCmdLabel(f, buf)
cmd.Flags().Set("filename", "../../../examples/cassandra/cassandra.yaml")
options := &LabelOptions{
Filenames: []string{"../../../examples/cassandra/cassandra.yaml"},
}
err := RunLabel(f, buf, cmd, []string{"a=b"})
err := RunLabel(f, buf, cmd, []string{"a=b"}, options)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
@@ -406,7 +408,7 @@ func TestLabelMultipleObjects(t *testing.T) {
cmd := NewCmdLabel(f, buf)
cmd.Flags().Set("all", "true")
if err := RunLabel(f, buf, cmd, []string{"pods", "a=b"}); err != nil {
if err := RunLabel(f, buf, cmd, []string{"pods", "a=b"}, &LabelOptions{}); err != nil {
t.Fatalf("unexpected error: %v", err)
}
if strings.Count(buf.String(), "labeled") != len(pods.Items) {