Update documentation to support multiple labels

This commit is contained in:
Ryan Baxter
2024-10-02 10:17:07 -04:00
parent 22043c5ebc
commit ac23ec2fc5
2 changed files with 5 additions and 3 deletions

View File

@@ -130,7 +130,6 @@ You can override all of them by setting `spring.cloud.config.\*` (where `*` is `
The `label` is useful for rolling back to previous versions of configuration.
With the default Config Server implementation, it can be a git label, branch name, or commit ID.
Label can also be provided as a comma-separated list.
In that case, the items in the list are tried one by one until one succeeds.
This behavior can be useful when working on a feature branch.
For instance, you might want to align the config label with your branch but make it optional (in that case, use `spring.cloud.config.label=myfeature,develop`).

View File

@@ -58,13 +58,16 @@ For example:
----
curl localhost:8888/foo/development
curl localhost:8888/foo/development/master
curl localhost:8888/foo/development,db/master
curl localhost:8888/foo/development,db/master,dev
curl localhost:8888/foo-development.yml
curl localhost:8888/foo-db.properties
curl localhost:8888/master/foo-db.properties
----
where `application` is injected as the `spring.config.name` in the `SpringApplication` (what is normally `application` in a regular Spring Boot app), `profile` is an active profile (or comma-separated list of properties), and `label` is an optional git label (defaults to `master`.)
where `application` is injected as the `spring.config.name` in the `SpringApplication` (what is normally `application` in a regular Spring Boot app), `profile` is an active profile (or comma-separated list of properties), and `label` is an optional git label (defaults to `main`.)
Just like with profiles, you can provide a comma separated list of labels and if the environment repositories used by the config server
supports labels it will return all property sources for those labels.
Spring Cloud Config Server pulls configuration for remote clients from various sources. The following example gets configuration from a git repository (which must be provided), as shown in the following example: