Class KubernetesPropertySourceImporter

java.lang.Object
io.micronaut.kubernetes.configuration.imports.KubernetesPropertySourceImporter
All Implemented Interfaces:
io.micronaut.context.env.PropertySourceImporter<ImportDeclaration>, io.micronaut.core.util.Toggleable, AutoCloseable

public final class KubernetesPropertySourceImporter extends Object implements io.micronaut.context.env.PropertySourceImporter<ImportDeclaration>
A PropertySourceImporter that resolves Micronaut configuration from Kubernetes ConfigMaps and Secrets.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.micronaut.context.env.PropertySourceImporter

    io.micronaut.context.env.PropertySourceImporter.ImportContext<T>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closes the lazily created application context used to resolve importer support beans.
    @NonNull String
     
    @NonNull Optional<io.micronaut.context.env.PropertySource>
    importPropertySource(@NonNull io.micronaut.context.env.PropertySourceImporter.ImportContext<ImportDeclaration> context)
    Imports a property source by delegating to ConfigMap or Secret import support based on the declaration type.
    newImportDeclaration(@NonNull io.micronaut.core.convert.value.ConvertibleValues<Object> values)
    Creates an import declaration from map-like configuration values.
    newImportDeclaration(@NonNull io.micronaut.core.util.ConnectionString connectionString)
    Creates an import declaration from a Kubernetes config import connection string.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.micronaut.core.util.Toggleable

    isEnabled
  • Field Details

    • KUBERNETES_CONFIG_IMPORT_CONTEXT_PROPERTY

      public static final String KUBERNETES_CONFIG_IMPORT_CONTEXT_PROPERTY
      See Also:
  • Constructor Details

    • KubernetesPropertySourceImporter

      public KubernetesPropertySourceImporter()
  • Method Details

    • getProvider

      public @NonNull String getProvider()
      Specified by:
      getProvider in interface io.micronaut.context.env.PropertySourceImporter<ImportDeclaration>
    • newImportDeclaration

      public @NonNull ImportDeclaration newImportDeclaration(@NonNull io.micronaut.core.util.ConnectionString connectionString)
      Creates an import declaration from a Kubernetes config import connection string.
      Specified by:
      newImportDeclaration in interface io.micronaut.context.env.PropertySourceImporter<ImportDeclaration>
      Parameters:
      connectionString - The parsed import connection string
      Returns:
      The normalized import declaration
    • newImportDeclaration

      public @NonNull ImportDeclaration newImportDeclaration(@NonNull io.micronaut.core.convert.value.ConvertibleValues<Object> values)
      Creates an import declaration from map-like configuration values.
      Specified by:
      newImportDeclaration in interface io.micronaut.context.env.PropertySourceImporter<ImportDeclaration>
      Parameters:
      values - The raw declaration values
      Returns:
      The normalized import declaration
    • importPropertySource

      public @NonNull Optional<io.micronaut.context.env.PropertySource> importPropertySource(@NonNull io.micronaut.context.env.PropertySourceImporter.ImportContext<ImportDeclaration> context)
      Imports a property source by delegating to ConfigMap or Secret import support based on the declaration type.
      Specified by:
      importPropertySource in interface io.micronaut.context.env.PropertySourceImporter<ImportDeclaration>
      Parameters:
      context - The import context containing the declaration to process
      Returns:
      The imported property source when one can be resolved
    • close

      public void close()
      Closes the lazily created application context used to resolve importer support beans.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface io.micronaut.context.env.PropertySourceImporter<ImportDeclaration>