Describe the bug I try to start my client application with multiple profiles by setting the active profile to: stage, support-stage I even see this line in the log:
2021-07-01 17:20:20.236 INFO [springboot-no-ui-tests,,] [ restartedMain] c.c.c.ConfigServicePropertySourceLocator : Located environment: name=springboot-no-ui-tests, profiles=[stage,support-stage], label=null, version=e9e9fda77b46039faa314499ba133f7af8411ef9, state=null
but for some reason only the first profile is being updated from the config server.
Does Spring cloud config knows how to handle multiple profiles coming from clients?
Comment From: avnerstr
The reason behind it, is because we want to have two repositories in GIT one for developers to change for their configuration and one for support people. When the client will run we want it to read the configuration from both places for the same app. That why we thought about setting multiple profiles in the client app for example here is the Spring cloud config server configuration for that:
repos:
cloud-waf-support:
pattern:
- 'springboot-no-ui-tests/support*'
cloneOnStart: true
uri: https://.../v1/repos/cloud-waf-support
default-label: main
cloud-waf:
pattern:
- 'springboot-no-ui-tests/*'
cloneOnStart: true
uri: https://.../v1/repos/cloud-waf
default-label: main
If you have another idea that will solve the issue it can be great
Comment From: avnerstr
Eventually I solve this requirement: repo for support and repo for dev with the composite solution:
cloud:
config:
server:
composite:
-
type: git
uri: https://git-codecommit.eu-west-2.amazonaws.com/v1/repos/fallback-repo
default-label: main
force-pull: true
username: yyy
password: xxx
clone-on-start: true
repos:
springboot-no-ui-tests:
clone-on-start: true
pattern:
- 'springboot-no-ui-tests'
clone-submodules: false
uri: https://git-codecommit.eu-west-2.amazonaws.com/v1/repos/dev-repo
force-pull: true
default-label: main
username: yyy
password: xxx
-
type: git
uri: https://git-codecommit.eu-west-2.amazonaws.com/v1/repos/fallback-repo
default-label: main
force-pull: true
username: xxx
password: yyy
clone-on-start: true
repos:
springboot-no-ui-tests:
clone-on-start: true
pattern:
- 'springboot-no-ui-tests'
clone-submodules: false
uri: https://git-codecommit.eu-west-2.amazonaws.com/v1/repos/support-repo
force-pull: true
default-label: main
username: yyy
password: xxx
Comment From: avnerstr
This can be closed.