Skip to content

Allow disabling the default environment repository - #3365

Merged
ryanjbaxter merged 3 commits into
spring-cloud:mainfrom
yashdotdev13:fix/1431-disable-embedded-config-server
Oct 30, 2026
Merged

ryanjbaxter merged 3 commits into
spring-cloud:mainfrom
yashdotdev13:fix/1431-disable-embedded-config-server

Conversation

@yashdotdev13

Copy link
Copy Markdown
Contributor

Summary

Closes #1431.

Allow the default environment repository to be disabled through configuration when embedding Spring Cloud Config Server in an application.

Previously, when no EnvironmentRepository was explicitly configured, the default Git repository was created and required a Git URI, even when loading external configuration was not desired.

This change introduces the following configuration property:

spring:
  cloud:
    config:
      server:
        default-repository:
          enabled: false

When set to false, the default Git environment repository is not created. The property defaults to true when absent to preserve existing behavior.

Testing

  • Added a test verifying that the default Git environment repository can be disabled.
  • Verified that EnvironmentRepositoryConfigurationTests passes.

Signed-off-by: 98001yash <yashchauhan.gaya@gmail.com>
@ryanjbaxter

Copy link
Copy Markdown
Contributor

Can we add documentation for the property and when it is useful to use? Also the documentation should call out the behavior the user will see when the property is false (I believe they will just get empty responses from the config server)

Signed-off-by: 98001yash <yashchauhan.gaya@gmail.com>
@yashdotdev13

Copy link
Copy Markdown
Contributor Author

Thanks for the review! i have added documentation for the new spring.cloud.config.server.default-repository.enabled property, including its default behavior and its use when embedding Config Server. The documentation distinguishes disabling the default repository from the separate spring.cloud.config.server.accept-empty setting.


You can set `spring.cloud.config.server.accept-empty` to `false` so that Server would return a HTTP 404 status, if the application is not found. By default, this flag is set to `true`.

== Disabling the Default Environment Repository

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should go in embedding.adoc

Signed-off-by: 98001yash <yashchauhan.gaya@gmail.com>
@yashdotdev13

Copy link
Copy Markdown
Contributor Author

Thanks for the suggestion! I have moved the documentation to embedding.adoc, since this configuration is primarily intended for embedded Config Server use cases.

@ryanjbaxter
ryanjbaxter merged commit ad834e0 into spring-cloud:main Oct 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow embedded config server to be disabled

3 participants