From b765203a911fc9cdc1b32ac1a3da3a9a9389bb1d Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Mon, 4 Jul 2016 15:04:38 -0400 Subject: [PATCH] Handle more cases in diff.ObjectReflectDiff Interfaces and nested map values were not being recursed. --- pkg/util/diff/diff.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/util/diff/diff.go b/pkg/util/diff/diff.go index a95a1d00550..f50ebd04bd0 100644 --- a/pkg/util/diff/diff.go +++ b/pkg/util/diff/diff.go @@ -145,7 +145,7 @@ func objectReflectDiff(path *field.Path, a, b reflect.Value) []diff { } } return changes - case reflect.Ptr: + case reflect.Ptr, reflect.Interface: if a.IsNil() || b.IsNil() { switch { case a.IsNil() && b.IsNil(): @@ -199,7 +199,7 @@ func objectReflectDiff(path *field.Path, a, b reflect.Value) []diff { if reflect.DeepEqual(a.MapIndex(key).Interface(), b.MapIndex(key).Interface()) { continue } - missing = append(missing, diff{path: path.Key(fmt.Sprintf("%s", key.Interface())), a: a.MapIndex(key).Interface(), b: b.MapIndex(key).Interface()}) + missing = append(missing, objectReflectDiff(path.Key(fmt.Sprintf("%s", key.Interface())), a.MapIndex(key), b.MapIndex(key))...) continue } missing = append(missing, diff{path: path.Key(fmt.Sprintf("%s", key.Interface())), a: nil, b: b.MapIndex(key).Interface()})