Open zheng-jx opened 3 days ago
I verified that this case indeed exist, do you have any idea how to solve this problem?
Modify the tableConvertor of resource_cache to be compatible with unstructured types and select the corresponding handler according to the unstructured GVK
We actually registered *v1.PodList
in handlerMap map[reflect.Type]*handlerEntry
,
but unfortunately obj runtime.Object
is not recognized as *v1.PodList
, but as *unstructured. UnstructuredList
.
select the corresponding handler according to the unstructured GVK
do you mean you want the handlerMap map[reflect.Type]*handlerEntry
to be as handlerMap map[GVK]*handlerEntry
?
Almost. Add a new map, such as map[GVK]*handlerEntry, and determine which one to use based on the reflect.Type.
I found this func (h *HumanReadableGenerator) GenerateTable
is not only called by karmada-search
, but also called by karmada-aggregated-apiserver
when I get resources handled by karmada-aggregated-apiserver
, like cluster
resource, the obj runtime.Object
can be normally recognized as *cluster.ClusterList
I am now a little curious about why karmada-aggregated-apiserver
can handle this problem correctly, this may be another breakthrough.
karmada-aggregated-apiserver should be directly proxied to the target cluster, karmada-search has a layer of cache
karmada-aggregated-apiserver should be directly proxied to the target cluster, karmada-search has a layer of cache
you are right, here list from MultiClusterCache
can only gets UnstructuredList
Add a new map, such as map[GVK]*handlerEntry
It seems a feasible solution. I currently don't have any better approach, so I'll wait for others' opinions.
4、*Others: In karmada-search, about tableConvertor, obj type is Unstructured but not pod