spring-cloud-config icon indicating copy to clipboard operation
spring-cloud-config copied to clipboard

Allow embedded config server to be disabled

Open scottfrederick opened this issue 7 years ago • 1 comments

When embedding Config Server in an application, it should be possible to disable loading configuration from an external source unless the app deployer explicitly defines an EnvironmentRepository configuration (e.g. in a bootstrap.yml file provided in a spring.cloud.bootstrap.location outside of the deployed application jar file).

Currently this is difficult to do. If no configuration is provided, the default is to use a git repository but this will fail to load because a spring.cloud.config.server.git.uri is required. You can provide a native repository with a dummy location as a default, but this must be done with a composite type to allow alternative repositories to override this default.

scottfrederick avatar Jul 29 '19 21:07 scottfrederick

I have opened PR #3365 to address this issue.

The change introduces the spring.cloud.config.server.default-repository.enabled property, allowing the default Git environment repository to be disabled when set to false, while preserving the existing behavior by default.

I have also added a test to verify that the default repository is not created when disabled.

yashdotdev13 avatar Oct 29 '26 16:10 yashdotdev13