Class KubernetesConfigUtils
java.lang.Object
io.micronaut.kubernetes.client.openapi.configuration.KubernetesConfigUtils
Utility methods for Kubernetes Configuration client.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcomputeLabelSelector(Map<String, String> labels) Creates a label selector filter based on the passed labels.computePodLabels(CoreV1ApiReactor client, List<String> podLabelKeys, String namespace, Map<String, String> labels, boolean exceptionOnPodLabelsMissing) Creates a label map from pod and passed labels.static reactor.core.publisher.Mono<String> computePodLabelSelector(CoreV1ApiReactor client, List<String> podLabelKeys, String namespace, Map<String, String> labels, boolean exceptionOnPodLabelsMissing) Creates a label selector filter from pod and passed labels.configMapAsMap(V1ConfigMap configMap, Collection<io.micronaut.context.env.PropertySourceLoader> propertySourceLoaders) Converts aV1ConfigMapinto aMap.static io.micronaut.context.env.PropertySourceconfigMapAsPropertySource(V1ConfigMap configMap, Collection<io.micronaut.context.env.PropertySourceLoader> propertySourceLoaders) Converts aV1ConfigMapinto aPropertySource.static StringcreatePropertySourceName(KubernetesObject kubernetesObject) Creates a property source name from given kubernetes object.static StringcreatePropertySourceName(String filePath, Class<? extends KubernetesObject> type) Creates a property source name from given file path.static StringcreateResVersionPropertyName(KubernetesObject kubernetesObject) Creates a property name for property which contains resource version of given kubernetes object.parseLabels(String labelsValue, String provider) secretAsMap(V1Secret secret) static io.micronaut.context.env.PropertySourcesecretAsPropertySource(V1Secret secret) Converts aV1Secretinto aPropertySource.
-
Field Details
-
API_PROPERTY_SOURCE_PRIORITY
public static final int API_PROPERTY_SOURCE_PRIORITY- See Also:
-
-
Method Details
-
createResVersionPropertyName
Creates a property name for property which contains resource version of given kubernetes object.- Parameters:
kubernetesObject- the kubernetes object- Returns:
- property name
-
createPropertySourceName
Creates a property source name from given kubernetes object.- Parameters:
kubernetesObject- the kubernetes object- Returns:
- property source name
-
createPropertySourceName
public static String createPropertySourceName(String filePath, Class<? extends KubernetesObject> type) Creates a property source name from given file path.- Parameters:
filePath- the file pathtype- the kubernetes type- Returns:
- property source name
-
configMapAsMap
public static Map<String,Object> configMapAsMap(V1ConfigMap configMap, Collection<io.micronaut.context.env.PropertySourceLoader> propertySourceLoaders) Converts aV1ConfigMapinto aMap.- Parameters:
configMap- theV1ConfigMapinstancepropertySourceLoaders- the collection of property source loaders- Returns:
Mapinstance
-
configMapAsPropertySource
public static io.micronaut.context.env.PropertySource configMapAsPropertySource(V1ConfigMap configMap, Collection<io.micronaut.context.env.PropertySourceLoader> propertySourceLoaders) Converts aV1ConfigMapinto aPropertySource.- Parameters:
configMap- theV1ConfigMapinstancepropertySourceLoaders- the collection of property source loaders- Returns:
PropertySourceinstance
-
secretAsMap
-
secretAsPropertySource
-
computePodLabelSelector
public static reactor.core.publisher.Mono<String> computePodLabelSelector(CoreV1ApiReactor client, List<String> podLabelKeys, String namespace, Map<String, String> labels, boolean exceptionOnPodLabelsMissing) Creates a label selector filter from pod and passed labels.- Parameters:
client- the clientpodLabelKeys- the list of label keys inside a podnamespace- the namespacelabels- the additional labelsexceptionOnPodLabelsMissing- should an exception be thrown if configured pod label key is not found in pod labels- Returns:
- the label selector filter
-
computePodLabels
public static @NonNull reactor.core.publisher.Mono<Map<String,String>> computePodLabels(CoreV1ApiReactor client, List<String> podLabelKeys, String namespace, Map<String, String> labels, boolean exceptionOnPodLabelsMissing) Creates a label map from pod and passed labels.- Parameters:
client- the clientpodLabelKeys- the list of label keys inside a podnamespace- the namespacelabels- the additional labelsexceptionOnPodLabelsMissing- should an exception be thrown if configured pod label key is not found in pod labels- Returns:
- the computed labels
-
parseLabels
-
computeLabelSelector
-