spring-cloud / spring-cloud/spring-cloud-config

Cloud Config Server should be able bootstrap resources

Open
#1,729 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #1732 by @rolaca11 — closed without merging
enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.