lensapp / lens

Lens - The way the world runs Kubernetes
https://k8slens.dev/
MIT License
22.53k stars 1.47k forks source link

all resources are empty #6303

Closed aep closed 2 years ago

aep commented 2 years ago

every resource list is empty. there appears to be something required by lens from the k8s api that we haven't implemented yet

for example here's the return of /api/v1/namespaces/default/pods

{
    "apiVersion": "v1",
    "items": [
        {
            "apiVersion": "v1",
            "kind": "Pod",
            "metadata": {
                "annotations": {
                    "kubectl.kubernetes.io/default-container": "mirthful_tree"
                },
                "creationTimestamp": "2022-09-21T12:24:38.763552Z",
                "name": "mirthful_tree",
                "namespace": "default",
                "uid": "0f7e30ce-bc59-4d5b-8a20-4daaa8bfb977"
            },
            "spec": {
                "containers": [
                    {
                        "image": "index.docker.io/library/ubuntu:latest",
                        "name": "mirthful_tree",
                        "volumeMounts": [
                            {
                                "mountPath": "/data",
                                "name": "testdata",
                                "readOnly": false,
                                "subPath": ""
                            }
                        ]
                    }
                ],
                "volumes": [
                    {
                        "name": "testdata",
                        "persistentVolumeClaim": {
                            "claimName": "testdata"
                        }
                    }
                ]
            },
            "status": {}
        }
   ]
}

but it's not showing up in lens. would be really nice to get a hint what we're missing in the returned json.

aep commented 2 years ago

figured it out: lens requires (unlike kubectl) that the outer List "metadata" field exists, even if its empty. this makes most of the apis work.

  "kind": "List",
+  "metadata": {}

would have been nice to get some sort of error log somewhere instead of failing silently

ghost commented 2 years ago

@aep How did you solve this issue? I'm having the same issue with OpenLens, but it works perfectly fine with Lens on the same version. Maybe it would worth to keep this open.

aep commented 2 years ago

if you're using the official kubernetes, this is unlikely to be the same issue.

ghost commented 2 years ago

I am, I guess the symptom is the same then, but it's a different underlying issue (similarly without any errors).