show patch error as string not byte slice

This commit is contained in:
deads2k
2017-03-01 08:00:07 -05:00
parent ed479163fa
commit ea887557d3
2 changed files with 30 additions and 10 deletions

View File

@@ -268,14 +268,26 @@ func TestPatch(t *testing.T) {
pb := patchBodies[c.Core().RESTClient().APIVersion()]
execPatch := func(pt types.PatchType, body []byte) error {
return c.Core().RESTClient().Patch(pt).
result := c.Core().RESTClient().Patch(pt).
Resource(resource).
Namespace(ns.Name).
Name(name).
Body(body).
Do().
Error()
Do()
if result.Error() != nil {
return result.Error()
}
// trying to chase flakes, this should give us resource versions of objects as we step through
jsonObj, err := result.Raw()
if err != nil {
t.Log(err)
} else {
t.Logf("%v", string(jsonObj))
}
return nil
}
for k, v := range pb {
// add label
err := execPatch(k, v.AddLabelBody)