Open tomplummercarfax opened 2 years ago
I'm not sure i understand this configuration...
You have 3 git repos, why use a composite at all?
We are using composite because our "database" configuration comes from both config-project-2 and config-project-4. For example we make the following request to the config server: http://the.url.to.our.config.server/alpha/database(_)appname-alpha.properties and we need configuration that is stored in both config-project-2 and config-project-4.
But why can't you choose either a git configuration or a composite repo? If you took what in the composite and put it under the git configuration wouldn't it pull configuration from config-project-2 and config-project-4 but not config-project-2. because the pattern wouldn't match?
I just experimented with what you suggested, but there appear to be problems with using only a git configuration or only using a composite configuration. If we put the current composite repo (config-project-4) as another git configuration, our database configuration does not pull from both config-project-2 and config-project-4, it only pulls from the one that matches first. If we make all of the repos composite repos, when we request database configuration we also get configuration from config-project-1 and config-project-3 in addition to config-project-2 and config-project-4. It appears patterns do not work for composite repos.
I understand that we may be handling our config server in an odd way, but why does it work fine the way we have it configured immediately after the config server is started, but not later when a repo needs to be refreshed? I'm open to finding a better way to configure our config server, but I would also like to know why we can't look at the actual problem I'm reporting.
Thanks for giving this a try. Before I went through the trouble to trying to see why the refreshed SSH key does not work, I wanted to see if there was another way of configuring the server that avoided the problem all together. Since this is not going to be strait forward to reproduce I wanted to see if there was another way.
Describe the bug We are using both the "Pattern Matching and Multiple Repositories" and "Composite Environment Repositories" features and we have different ssh keys for different git repos. When the config server is started/restarted all of our configuration is served appropriately. However if configuration is updated in one of our Composite Environment Repositories (and the config server is not restarted) the changes are never served (even after the refresh-rate has passed). We turned on debug logging and found the following exception when trying to request configuration from the config server:
It appears that Spring Cloud Config is attempting to use the key from one of the non-Composite git repos when trying to pull new config from the Composite git repo, because when we added the private key we were using for the non-Composite repo to the Composite repo Spring Cloud Config was able to pull the changes.
We are using org.springframework.cloud:spring-cloud-config-server:3.0.4.
Sample Here is a copy of our application.yml for our spring cloud config server (I changed some project names and excluded the actual keys):