client-go: object return by client-go informer don't have api Kind info
When I use informer to watch cluster resource infos, I find runtime.Object return by informer don’t include object Kind info.
fmt.Println(obj.GetObjectKind().GetVersionKind().String()) print /, Kind=
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 28 (13 by maintainers)
Commits related to this issue
- Adding JSON and YAML output capabilities Note: This is not 100% complete. Right now, we do not obtain the metav1.TypeMeta within svcat. We will need to figure out how to populate this. See: https://... — committed to jeremyrickard/service-catalog by jeremyrickard 6 years ago
- Adding JSON and YAML output capabilities Note: This is not 100% complete. Right now, we do not obtain the metav1.TypeMeta within svcat. We will need to figure out how to populate this. See: https://... — committed to jeremyrickard/service-catalog by jeremyrickard 6 years ago
- Add JSON and YAML output to svcat (#1944) * Initial WIP commit for adding JSON/YAML output to svcat This adds JSON/YAML output to svcat, but does not currently include the Type Metadata, so we lo... — committed to kubernetes-retired/service-catalog by jeremyrickard 6 years ago
- injector: fix correctness while checking for annotations Addresses an issue where a log message indicates an annotation being present when it isn't, only because accessing an invalid key on the map a... — committed to shashankram/osm by shashankram 3 years ago
- injector: fix correctness while checking for annotations Addresses an issue where a log message indicates an annotation being present when it isn't, only because accessing an invalid key on the map a... — committed to shashankram/osm by shashankram 3 years ago
- injector: fix correctness while checking for annotations Addresses an issue where a log message indicates an annotation being present when it isn't, only because accessing an invalid key on the map a... — committed to shashankram/osm by shashankram 3 years ago
- injector: fix correctness while checking for annotations Addresses an issue where a log message indicates an annotation being present when it isn't, only because accessing an invalid key on the map a... — committed to shalier/osm by shashankram 3 years ago
- injector: fix correctness while checking for annotations Addresses an issue where a log message indicates an annotation being present when it isn't, only because accessing an invalid key on the map a... — committed to brunoterkaly/osm by shashankram 3 years ago
- Namespace enforcement exclusion fails due to missing object type meta Based on https://github.com/kubernetes/client-go/issues/308 the type meta is erased on object returned by cache informers. excl... — committed to amuraru/prometheus-operator by amuraru 2 years ago
- Namespace enforcement exclusion fails due to missing object type meta Based on https://github.com/kubernetes/client-go/issues/308 the type meta is erased on object returned by cache informers. excl... — committed to amuraru/prometheus-operator by amuraru 2 years ago
- Set the missing Kind in the reposync controller logs It is a common issue with List and Watch: the result doesn't include the GVK. This commit follows the example [1] to make a function that populat... — committed to GoogleContainerTools/kpt-config-sync by a-googler 2 years ago
- Namespace enforcement exclusion fails due to missing object type meta Based on https://github.com/kubernetes/client-go/issues/308 the type meta is erased on object returned by cache informers. excl... — committed to amuraru/prometheus-operator by amuraru 2 years ago
- Namespace enforcement exclusion fails due to missing object type meta (#4915) * Namespace enforcement exclusion fails due to missing object type meta Based on https://github.com/kubernetes/clien... — committed to prometheus-operator/prometheus-operator by amuraru 2 years ago
For those of us still looking for a concise way to add TypeMeta information to runtime objects, here you go!
Reported in kubernetes/kubernetes#3030
Fix in progress in kubernetes/kubernetes#63972
The k8s REST API does not provide the
Kindvalue.kubectl(or one of its dependencies) inserts theKindinformation. Perhaps the code that figures theKindinfo can be moved toclient-go? Just for example, seegetcmd and how it inserts theListvalue.I don’t think the Kind is returned either with
ListThank you for the update @nikhita!