kubernetes / client-go

Go client for Kubernetes.
Apache License 2.0
8.79k stars 2.91k forks source link

Prioritized elements in NewDiscoveryRESTMapper do not match any group #1259

Closed tenstad closed 1 year ago

tenstad commented 1 year ago

The two prioritized elements in NewDiscoveryRESTMapper have Group "" rather than meta.AnyGroup ("*"), making them not match any nonempty groups in resourceMatches.

// /v1 is special.  It should always come first
resourcePriority := []schema.GroupVersionResource{{Group: "", Version: "v1", Resource: meta.AnyResource}}
kindPriority := []schema.GroupVersionKind{{Group: "", Version: "v1", Kind: meta.AnyKind}}
tenstad commented 1 year ago

The core kube API, empty group, version==v1 should always be the most preferred group https://github.com/kubernetes/kubernetes/pull/42275

Seems to be intended