spring-cloud / spring-cloud/spring-cloud-config
Cloud Config Server should be able bootstrap resources
Nobody has claimed this yet.
- #1732 by @rolaca11 — closed without merging
- Dominant language
- Java
- Stars
- 2k
- Forks
- 1.3k
- Avg merge
- 2d 59m
- Merged PRs (30d)
- 16
Description
Is your feature request related to a problem? Please describe.
When the spring.cloud.config.server.bootstrap property is set to true, the config-server should configure itself like it was any other config-client, which it does well, as long as you don't need a resource, like a logback-spring.xml during bootstraping.
This is not a problem for clients, because I can just use a config like this: logging.config=${spring.cloud.config.uri:http://localhost:8888/}/${spring.application.name}/${spring.profiles.active:default}/master/logback-spring.xml and the client will send another request to the config server asking for this resource.
The problem is that during config-server bootstraping, this endpoint is not yet available.
Describe the solution you'd like
I don't know if there are other usecases (not logging reinitialization related) where this issue arises. If there aren't (which I suspect is the case) than the solution is simply to try and request the resource bypassing the endpoint, for example by invoking this.repository.findOne(name, profiles, label, includeOrigin); directly.
code taken from org.springframework.cloud.config.server.environment.EnvironmentController:136
If there are other usecases, we might need a more sophisticated solution.
Describe alternatives you've considered
I have considered some hacky solutions by defining root search locations, but these are shady and situational.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at org.springframework.cloud.config.server.environment.EnvironmentController around line 136 and inspect the bootstrap path controlled by spring.cloud.config.server.bootstrap. Compare it with repository.findOne(name, profiles, label, includeOrigin); done means bootstrap can obtain the needed resource without relying on the unavailable endpoint, with tests covering the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring, spring-boot
- Domain
- backend, cloud
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100