Open jpeach opened 4 years ago
In my case these errors were caused by multiple "pods" resources:
$ kubectl api-resources | grep -w pods
pods po true Pod
pods metrics.k8s.io true PodMetrics
I "fixed" this by stopping after the first one:
--- a/pkg/driver/kubernetes.go
+++ b/pkg/driver/kubernetes.go
@@ -138,6 +138,7 @@ func (k *KubeClient) ResourcesForName(name string) ([]schema.GroupVersionResourc
Version: r.Version,
Resource: r.Name,
})
+ break
}
return matched, nil
Ah I see. I don't think it's right to just break there (it would not work if we happened to list the resources in the reverse order for example). We probably want to deal with this at a slightly higher layer - need some way to know that by "pods" we mean the core not the metrics.
No it definitely isn't right, hence the "fixed" in quotes :-)
I'd suggest that the group needs to be explicit and defaults to empty if not specified, so:
which is the same way "kubectl get" works.
No it definitely isn't right, hence the "fixed" in quotes :-)
:)
I'd suggest that the group needs to be explicit and defaults to empty if not specified, so:
- "pods" means group "" and resource "pods"
- "pods.metrics.k8s.io" means group "metrics.k8s.io" and resource "pods"
which is the same way "kubectl get" works.
Yeh that makes sense. Does Kubectl have some programmatic disambiguation?
What steps did you take and what happened:
Running Contour tests on GKE.
What did you expect to happen:
They should pass (they do on kind).
Anything else you would like to add:
It looks like something goes wrong when we may the
GroupVersionResource
and start an informer.