feat(config): Resolve configfiles using a custom PropertySource #370
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Spring Cloud Config Server integration provided by
kork-config
includes the ability to specify account credentials (e.g. Kubernetes accountkubeconfigfile
and Google accountjson-path
) as files that are stored in a Config Server backend like git, using aconfigserver:
qualifier.Previously code in services that accessed these file references in account properties needed to use a
ConfigFileService
bean provided bykork-config
to resolve the file references, pulling the specified file from the Config Server backend if necessary.This was starting to get unwieldy and intrusive in services, especially in cases where the code using the account properties wasn't implemented as Spring beans that could get a
ConfigFileService
bean injected into it. This PR adds a SpringPropertySource
wrapper that automatically de-references theconfigserver:
file reference when a property is resolved. The result is that services will always get a absolute local file reference.ConfigFileService
remains as a useful encapsulation of methods for dealing with local files.