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
ModifierConstructorDescriptionprotected
AbstractKubeConfigLoader
(io.micronaut.core.io.ResourceResolver resourceResolver) -
Method Summary
Modifier and TypeMethodDescriptionReturnsKubeConfig
instance which contains data from the kube config file.protected abstract @Nullable KubeConfig
protected KubeConfig
loadKubeConfigFromFile
(String filePath) Loads kube config from the file on given path.protected KubeConfig
loadKubeConfigFromInputStream
(InputStream inputStream) Loads kube config from the given input stream.
-
Constructor Details
-
AbstractKubeConfigLoader
protected AbstractKubeConfigLoader(io.micronaut.core.io.ResourceResolver resourceResolver)
-
-
Method Details
-
getKubeConfig
Description copied from interface:KubeConfigLoader
ReturnsKubeConfig
instance which contains data from the kube config file. The method is called multiple times during the application context startup so theKubeConfig
instance 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:
getKubeConfig
in interfaceKubeConfigLoader
- Returns:
- kube config
-
loadKubeConfig
-
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
-