From 49c86bde556d4530f0d642511679ac1cacbe5f1c Mon Sep 17 00:00:00 2001 From: Kevin Delgado Date: Tue, 27 Jul 2021 20:54:09 +0000 Subject: [PATCH] fix extract_test --- .../src/k8s.io/apimachinery/pkg/util/managedfields/extract.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staging/src/k8s.io/apimachinery/pkg/util/managedfields/extract.go b/staging/src/k8s.io/apimachinery/pkg/util/managedfields/extract.go index 831d6a546dc..792badbc3d5 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/managedfields/extract.go +++ b/staging/src/k8s.io/apimachinery/pkg/util/managedfields/extract.go @@ -78,7 +78,7 @@ func ExtractInto(object runtime.Object, objectType typed.ParseableType, fieldMan // set the type meta manually if it doesn't exist to avoid missing kind errors // when decoding from unstructured JSON - if _, ok := m["kind"]; !ok { + if _, ok := m["kind"]; !ok && object.GetObjectKind().GroupVersionKind().Kind != "" { m["kind"] = object.GetObjectKind().GroupVersionKind().Kind m["apiVersion"] = object.GetObjectKind().GroupVersionKind().GroupVersion().String() }