Class AbstractKubeConfigLoader
java.lang.Object
io.micronaut.kubernetes.client.openapi.config.AbstractKubeConfigLoader
- All Implemented Interfaces:
KubeConfigLoader
- Direct Known Subclasses:
DefaultKubeConfigLoader
Abstract implementation of
KubeConfigLoader which provides common methods for loading kube config.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractKubeConfigLoader(io.micronaut.core.io.ResourceResolver resourceResolver) Creates a new kube config loader. -
Method Summary
Modifier and TypeMethodDescription@Nullable KubeConfigReturnsKubeConfiginstance which contains data from the kube config file.protected abstract @Nullable KubeConfigLoads the kube config.protected KubeConfigloadKubeConfigFromFile(String filePath) Loads kube config from the file on given path.protected KubeConfigloadKubeConfigFromInputStream(InputStream inputStream) Loads kube config from the given input stream.
-
Constructor Details
-
AbstractKubeConfigLoader
protected AbstractKubeConfigLoader(io.micronaut.core.io.ResourceResolver resourceResolver) Creates a new kube config loader.- Parameters:
resourceResolver- the resource resolver
-
-
Method Details
-
getKubeConfig
Description copied from interface:KubeConfigLoaderReturnsKubeConfiginstance which contains data from the kube config file. The method is called multiple times during the application context startup so theKubeConfiginstance should be created when the method is called for the first time, cached and then returned by subsequent calls. Since it is called only in the context startup, it doesn't require thread synchronization.- Specified by:
getKubeConfigin interfaceKubeConfigLoader- Returns:
- kube config
-
loadKubeConfig
Loads the kube config.- Returns:
- the kube config, or null if no kube config is available
-
loadKubeConfigFromFile
Loads kube config from the file on given path.- Parameters:
filePath- the file path- Returns:
- instance of
KubeConfig
-
loadKubeConfigFromInputStream
Loads kube config from the given input stream.- Parameters:
inputStream- the input stream- Returns:
- instance of
KubeConfig
-