-
Notifications
You must be signed in to change notification settings - Fork 169
Description
This issue is to look into using profiles as suggested by @TimHess in the below comment.
Steeltoe supports multiple labels, but stops at the first one it finds since you probably don't want to config values from multiple branches. I suspect you want to use `profiles` rather than labels
Originally posted by @TimHess in #1284 (comment)
What i am wanting to achieve is the grouping of config based on what they achieve for instance a Eureka Profile, a client application should only use the profiles which are active as defined under: https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#_environment_repository
However when looking at the code, currently there is only 1 location where in which profiles are referenced which are in the return object:
Steeltoe/src/Configuration/src/ConfigServerBase/ConfigServerConfigurationProvider.cs
Line 339 in 8ae9892
"Located environment name: {name}, profiles: {profiles}, labels: {label}, version: {version}, state: {state}", env.Name, env.Profiles, env.Label, env.Version, env.State); |
which is probably ok if we are to assume the server does the filtering which i believe should be the case.
Looking at the properties which populates the config server url, it appears that the profile is coded to be the Environment as defined in settings which I don't feel is correct as the active should be defined separately.
Steeltoe/src/Configuration/src/ConfigServerBase/ConfigServerConfigurationProvider.cs
Line 727 in 8ae9892
var path = $"{_settings.Name}/{_settings.Environment}"; |
I also feel that if no active profiles are defined the profile "Default" be more accurate as mentioned in (https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#config-data-import)?
At the same time the environment Endpoint is not reading the active profiles from config but instead is always returning just the Environment name as the profile.
IList<string> activeProfiles = new List<string>() { _env.EnvironmentName }; |
My expectation would be that a user can define the active profiles as described in the above link, and those values are returned from the server using the environment endpoint and at the same time it is used to ensure only the relevant config is fetched from the server.
Note have created #1295 to handle the step process.