Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(config): Resolve configfiles using a custom PropertySource #370

Merged
merged 4 commits into from
Sep 3, 2019
Merged

feat(config): Resolve configfiles using a custom PropertySource #370

merged 4 commits into from
Sep 3, 2019

Conversation

scottfrederick
Copy link
Contributor

The Spring Cloud Config Server integration provided by kork-config includes the ability to specify account credentials (e.g. Kubernetes account kubeconfigfile and Google account json-path) as files that are stored in a Config Server backend like git, using a configserver: qualifier.

Previously code in services that accessed these file references in account properties needed to use a ConfigFileService bean provided by kork-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 Spring PropertySource wrapper that automatically de-references the configserver: 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.

@scottfrederick
Copy link
Contributor Author

@ethanfrogers @ncknt If you're testing the config server integration in clouddriver using e.g. kubeconfigFile: configserver:kubeconfig.yml, this change should be transparent. I've tested with my k8s config, but any additional testing and review would be appreciated.

@Jammy-Louie Jammy-Louie merged commit e3d1996 into spinnaker:master Sep 3, 2019
@scottfrederick scottfrederick deleted the config-server-autoconfig branch September 3, 2019 14:36
claymccoy pushed a commit to claymccoy/kork that referenced this pull request Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants