-
Kubernetes Submit Queue authored
Automatic merge from submit-queue Match GroupVersionKind against specific version Currently when multiple GVK match a specific kind in `KindForGroupVersionKinds` only the first will be matched, which not necessarily will be the correct one. I'm proposing to extend this to pick the best match, instead. Here's my problematic use-case, of course it involves ScheduledJobs :wink:: I have a `GroupVersions` with `batch/v1` and `batch/v2alpha1` in that order. I'm calling `KindForGroupVersionKinds` with kind `batch/v2alpha1 ScheduledJob` and that currently results this matching first `GroupVersion`, instead of picking more concrete one. There's a [clear description](https://github.com/kubernetes/kubernetes/blob/ee77d4e6ca1e174a189071e50997a377bcb6fc37/pkg/api/unversioned/group_version.go#L183) why it is on single `GroupVersion`, but `GroupVersions` should pick this more carefully. @deads2k this is your baby, wdyt?
049ad985