Class AbstractKubeConfigLoader

java.lang.Object
io.micronaut.kubernetes.client.openapi.config.AbstractKubeConfigLoader
All Implemented Interfaces:
KubeConfigLoader
Direct Known Subclasses:
DefaultKubeConfigLoader

public abstract class AbstractKubeConfigLoader extends Object implements KubeConfigLoader
Abstract implementation of KubeConfigLoader which provides common methods for loading kube config.
  • Constructor Details

    • AbstractKubeConfigLoader

      protected AbstractKubeConfigLoader(io.micronaut.core.io.ResourceResolver resourceResolver)
  • Method Details

    • getKubeConfig

      public KubeConfig getKubeConfig()
      Description copied from interface: KubeConfigLoader
      Returns KubeConfig instance which contains data from the kube config file. The method is called multiple times during the application context startup so the KubeConfig 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 interface KubeConfigLoader
      Returns:
      kube config
    • loadKubeConfig

      @Nullable protected abstract @Nullable KubeConfig loadKubeConfig()
    • loadKubeConfigFromFile

      protected KubeConfig loadKubeConfigFromFile(String filePath)
      Loads kube config from the file on given path.
      Parameters:
      filePath - the file path
      Returns:
      instance of KubeConfig
    • loadKubeConfigFromInputStream

      protected KubeConfig loadKubeConfigFromInputStream(InputStream inputStream)
      Loads kube config from the given input stream.
      Parameters:
      inputStream - the input stream
      Returns:
      instance of KubeConfig