mirror of
https://github.com/kubernetes/sample-controller.git
synced 2025-01-31 17:02:52 +08:00
Update deprecated diff.ObjectGoPrintDiff method
Use `diff.ObjectGoPrintSideBySide` to print the difference. Kubernetes-commit: 291c145bc567ca8ef82aee14098d0dda7c818300
This commit is contained in:
parent
38d625004d
commit
1e56cadeb7
@ -182,7 +182,7 @@ func checkAction(expected, actual core.Action, t *testing.T) {
|
|||||||
|
|
||||||
if !reflect.DeepEqual(expObject, object) {
|
if !reflect.DeepEqual(expObject, object) {
|
||||||
t.Errorf("Action %s %s has wrong object\nDiff:\n %s",
|
t.Errorf("Action %s %s has wrong object\nDiff:\n %s",
|
||||||
a.GetVerb(), a.GetResource().Resource, diff.ObjectGoPrintDiff(expObject, object))
|
a.GetVerb(), a.GetResource().Resource, diff.ObjectGoPrintSideBySide(expObject, object))
|
||||||
}
|
}
|
||||||
case core.UpdateAction:
|
case core.UpdateAction:
|
||||||
e, _ := expected.(core.UpdateAction)
|
e, _ := expected.(core.UpdateAction)
|
||||||
@ -191,7 +191,7 @@ func checkAction(expected, actual core.Action, t *testing.T) {
|
|||||||
|
|
||||||
if !reflect.DeepEqual(expObject, object) {
|
if !reflect.DeepEqual(expObject, object) {
|
||||||
t.Errorf("Action %s %s has wrong object\nDiff:\n %s",
|
t.Errorf("Action %s %s has wrong object\nDiff:\n %s",
|
||||||
a.GetVerb(), a.GetResource().Resource, diff.ObjectGoPrintDiff(expObject, object))
|
a.GetVerb(), a.GetResource().Resource, diff.ObjectGoPrintSideBySide(expObject, object))
|
||||||
}
|
}
|
||||||
case core.PatchAction:
|
case core.PatchAction:
|
||||||
e, _ := expected.(core.PatchAction)
|
e, _ := expected.(core.PatchAction)
|
||||||
@ -200,7 +200,7 @@ func checkAction(expected, actual core.Action, t *testing.T) {
|
|||||||
|
|
||||||
if !reflect.DeepEqual(expPatch, patch) {
|
if !reflect.DeepEqual(expPatch, patch) {
|
||||||
t.Errorf("Action %s %s has wrong patch\nDiff:\n %s",
|
t.Errorf("Action %s %s has wrong patch\nDiff:\n %s",
|
||||||
a.GetVerb(), a.GetResource().Resource, diff.ObjectGoPrintDiff(expPatch, patch))
|
a.GetVerb(), a.GetResource().Resource, diff.ObjectGoPrintSideBySide(expPatch, patch))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user