Git always wins in a composite version
Having the following composite setup for config server (2021.0.0, Boot 2.6.3)
$ curl https://start.spring.io/starter.tgz -d dependencies=cloud-config-server,cloud-starter-vault-config \
-d language=java -d type=maven-project -d baseDir=spring-cloud-config-server | tar -xzvf -
Annotated the class with @EnableConfigServer
.application.yml
spring:
cloud:
vault:
# [Vault] token
token: vault-plaintext-root-token
config:
server:
composite:
- type: vault
kv-version: 2
- type: git
uri: https://github.com/marcingrzejszczak/config-server-properties
profiles:
# [Vault & git]
active: composite
# default port
server.port: 8888
Inserting such vault entries
$ vault kv put secret/bar,foo a="bar with foo profile value from Vault"
Having such git repo
.bar-foo.properties
a=default with foo profile value from git
When sending a request to retrieve the properties for app bar with profile foo I get back a from git not from vault
curl localhost:8888/bar-foo.properties -H "X-Config-Token: vault-plaintext-root-token"
When I remove git from the composite setup I get a equal to bar with foo profile value from Vault
@marcingrzejszczak Please try this:
spring:
cloud:
config:
server:
vault:
order: 1
...
git:
order: 2
...
and use profile git,vault.
I did try it out and the only difference was that I had vault,git as profile orders. I'll need to double check my setup in general.
Yeah, there was some glitch with a profile order. Try git,vault instead.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.