From 06945f2b0ed0377ba64c0015a227347cd97853d4 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Tue, 7 Apr 2026 18:12:54 -0400 Subject: [PATCH] switch tag Get("json") to Lookup("json") Kubernetes-commit: ef2e578f14fe666eb8a7296ea19f8284c1df5e7b --- util/jsonpath/jsonpath.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/jsonpath/jsonpath.go b/util/jsonpath/jsonpath.go index 86a3d6dde..91525c0b4 100644 --- a/util/jsonpath/jsonpath.go +++ b/util/jsonpath/jsonpath.go @@ -361,7 +361,7 @@ func (j *JSONPath) findFieldInValue(value *reflect.Value, node *FieldNode) (refl var inlineValue *reflect.Value for ix := 0; ix < t.NumField(); ix++ { f := t.Field(ix) - jsonTag := f.Tag.Get("json") + jsonTag, _ := f.Tag.Lookup("json") parts := strings.Split(jsonTag, ",") if len(parts) == 0 { continue @@ -369,7 +369,7 @@ func (j *JSONPath) findFieldInValue(value *reflect.Value, node *FieldNode) (refl if parts[0] == node.Value { return value.Field(ix), nil } - if len(parts[0]) == 0 { + if len(parts[0]) == 0 && f.Anonymous { val := value.Field(ix) inlineValue = &val }