You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is basically a reopen from #541 because I did not see why @shsjshentao closed this in the first place.
After listing / getting resources with client-go (tested with Deployments, StatefulSets and DaemonSets), obj.TypeMeta is empty. The fields Kind and ApiVersion are empty strings.
After the REST call and JSON deserialisation the data is still available, but is is explicitly cleared:
// Decode does not do conversion. It removes the gvk during deserialization.func (dWithoutVersionDecoder) Decode(data []byte, defaults*schema.GroupVersionKind, intoObject) (Object, *schema.GroupVersionKind, error) {
obj, gvk, err:=d.Decoder.Decode(data, defaults, into)
ifobj!=nil {
kind:=obj.GetObjectKind()
// clearing the gvk is just a convention of a codeckind.SetGroupVersionKind(schema.GroupVersionKind{})
}
returnobj, gvk, err
}
Is there any specific reason while this is necessary? This is valuable information that I need later to set OwnerReferences and for logging. I tried with git blame to check for the commit / PR this was introduced, but there was no information.
The text was updated successfully, but these errors were encountered:
Yes. It is returned, but reset by client-go. After fetching from the server all information is present, but the func (d WithoutVersionDecoder) Decode func (see posting) clear that information.
This is basically a reopen from #541 because I did not see why @shsjshentao closed this in the first place.
After listing / getting resources with client-go (tested with Deployments, StatefulSets and DaemonSets),
obj.TypeMeta
is empty. The fieldsKind
andApiVersion
are empty strings.After the REST call and JSON deserialisation the data is still available, but is is explicitly cleared:
https://github.com/kubernetes/apimachinery/blob/02a41040d88da08de6765573ae2b1a51f424e1ca/pkg/runtime/helper.go#L255C8-L263
Is there any specific reason while this is necessary? This is valuable information that I need later to set
OwnerReferences
and for logging. I tried with git blame to check for the commit / PR this was introduced, but there was no information.The text was updated successfully, but these errors were encountered: