public class KubernetesVersionPriority extends Object
The Kubernetes specs at Version Priority state the following:
KubernetesVersionFactory.KubernetesVersion#compareTo(Version)
,
KubernetesVersionFactory.NonKubernetesVersion#compareTo(Version)
Modifier and Type | Method and Description |
---|---|
static String |
highestPriority(List<String> versions)
Returns the version with the highest priority for the given list of versions.
|
static <T> List<T> |
sortByPriority(List<T> resources,
Function<T,String> versionProvider)
Returns a sorted list of resources, for example,
CustomResourceDefinitionVersion s,
ordered from highest to lowest priority. |
public static String highestPriority(List<String> versions)
versions
- the versions to pick the version with the highest priority fromCustomResourceDefinitionVersion.getName()
,
CustomResourceDefinitionSpec.getVersions()
,
KubernetesVersionPriority
public static <T> List<T> sortByPriority(List<T> resources, Function<T,String> versionProvider)
CustomResourceDefinitionVersion
s,
ordered from highest to lowest priority.T
- the resource typeresources
- the resources to sortversionProvider
- a function to provide the version from the resourceCustomResourceDefinitionVersion.getName()
,
CustomResourceDefinitionSpec.getVersions()
,
KubernetesVersionPriority
Copyright © 2015–2024 Red Hat. All rights reserved.