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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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.@NonNull ImportDeclarationnewImportDeclaration(@NonNull io.micronaut.core.convert.value.ConvertibleValues<Object> values) Creates an import declaration from map-like configuration values.@NonNull ImportDeclarationnewImportDeclaration(@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, waitMethods inherited from interface io.micronaut.core.util.Toggleable
isEnabled
-
Field Details
-
KUBERNETES_CONFIG_IMPORT_CONTEXT_PROPERTY
- See Also:
-
-
Constructor Details
-
KubernetesPropertySourceImporter
public KubernetesPropertySourceImporter()
-
-
Method Details
-
getProvider
- Specified by:
getProviderin interfaceio.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:
newImportDeclarationin interfaceio.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:
newImportDeclarationin interfaceio.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:
importPropertySourcein interfaceio.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:
closein interfaceAutoCloseable- Specified by:
closein interfaceio.micronaut.context.env.PropertySourceImporter<ImportDeclaration>
-