Commit Graph

185 Commits

Author SHA1 Message Date
Spencer Gibb
100be64192 Ensures health indicator uses configured label.
fixes gh-638

(cherry picked from commit 30a1f81)
2017-02-14 11:44:15 -07:00
Patrick Coray
853f4d7853 Sync with upstream 2016-11-29 21:00:15 +01:00
rlynch2
102dcf41cd Added TagOps.FETCH_TAGS to the fetch command so we get all tags. 2016-11-05 16:23:21 -07:00
rlynch2
01698dd998 Added TagOps.FETCH_TAGS to the fetch command so we get all tags. 2016-11-05 15:59:42 -07:00
rlynch2
588870ca5f Fixed codacy warnings/errors. 2016-11-04 13:04:57 -07:00
rlynch2
09377f38b8 Fixed codacy warnings/errors. 2016-11-04 12:59:18 -07:00
rlynch2
33649fde53 Fixed codacy warnings/errors and added unit tests to test exception scenarios and increase code coverage. 2016-11-04 12:46:48 -07:00
rlynch2
e88f12b574 version not being updated on first request after update (including due to hard resets)
New remote branches
New remote tags
— handling a null ref in should pull no longer needed.
— has added benefit of ensuring the local repo is current in case of git failure.
Returns version for tags (version was null before this change)
New starter code for remote repo testing (where a lot of the complexity lies)
2016-11-03 22:26:29 -07:00
rlynch2
25a6e2d58d version not being updated on first request after update (including due to hard resets)
New remote branches
New remote tags
— handling a null ref in should pull no longer needed.
— has added benefit of ensuring the local repo is current in case of git failure.
Returns version for tags (version was null before this change)
New starter code for remote repo testing (where a lot of the complexity lies)
2016-11-03 17:46:35 -07:00
rlynch2
9a3e58e8fe version not being updated on first request
New remote branches
New remote tags
— handling a null ref in should pull no longer needed.
— has added benefit of ensuring the local repo is current in case of git failure.
Returns version for tags
New starter code for remote repo testing (where a lot of the complexity lies)
TODO: Still investigating failure of pullDirtyRepo.  I think the test is incorrect but still validating.
2016-11-03 17:38:21 -07:00
Patrick Coray
0cd7bf991c Keep formatting of file 2016-11-03 01:29:01 +01:00
Patrick Coray
8e98a309d7 Add test to check if baseDir is deleted when clone fails 2016-11-03 01:18:48 +01:00
Patrick Coray
9b51c34d7b Delete basedir when clone fails 2016-11-03 00:47:40 +01:00
rlynch2
3292f71902 Cleaned up a minor codacy warning. 2016-10-26 14:02:50 -07:00
rlynch2
9df9fbd1ab Adding comment as requested by spring 2016-10-26 13:55:33 -07:00
rlynch2
97e6ec4308 Merge branch 'master' of https://github.com/spring-cloud/spring-cloud-config 2016-10-26 09:44:49 -07:00
Spencer Gibb
d3cdfd35a5 comment out test for correct content type 2016-10-25 15:10:33 -06:00
Spencer Gibb
465bc94953 Make config server configuration deterministic.
Move @Import from EnableConfigServer to ConfigServerAutoConfiguration that is only activated if Marker bean created by EnableConfigServer exists.

fixes gh-530
2016-10-25 14:44:34 -06:00
rlynch2
9300bee308 Fixed bug which returns incorrect version number on first request after remote repo is updated. Fixed circleci warnings. 2016-10-24 21:50:33 -07:00
rlynch2
d5f4d8ed60 Fixed bug which returns incorrect version number on first request after remote repo is updated. Corrected imports. 2016-10-24 17:49:08 -07:00
rlynch2
2a3c60feb4 Fixed bug which returns incorrect version number on first request after remote repo is updated. 2016-10-24 17:41:05 -07:00
Johnny Lim
9a3903d088 Fix inline comments in EnvironmentControllerTests 2016-10-04 13:31:11 +09:00
Dave Syer
f596d138aa Fix line endings 2016-09-28 18:03:30 -04:00
Dave Syer
b827877283 Use concrete types in EnviromentRepository bean definitions
so that @OnMissingBeanCondition has a chance to detect all the
interfaces.
2016-09-28 18:02:22 -04:00
Dave Syer
53e049a812 Ensure EnvironmentController does not leak system properties
In the JSON and YAML endpoints system properties and env vars could
leak if the config contains placeholders with default values.
This change explicitly switches off that replacement (making the
JSON and JAML consistent with the properties endpoint).

Fixes gh-480, closes gh-492
2016-09-20 10:55:15 +01:00
Daniel Lavoie
a68882937b Handle git backend repository updated with force push
Fixes gh-481
2016-09-03 12:35:56 +02:00
Sascha Krüger
648f43c22d Improve logging of JGit exceptions
In some situations the JGit library can fail to update the local Git repository.
While the config server should gracefully handle these situations some added
information from the root cause might be helpful to pinpoint why changes in the
remote repository do not get reflected in the REST API.

fixes gh-364
2016-08-30 13:19:16 -06:00
John Moon
d2ce0e18c1 throw exception if label doesn't exist 2016-08-25 09:20:34 -04:00
transamericamoon
c0563be4da nested if statements 2016-08-24 12:31:22 -04:00
jmandawg
16bc9d38b9 added unit test for svn label fix 2016-08-23 21:23:33 -04:00
John Moon
67989c78db fix svn to check branches and tags folder for label 2016-08-23 15:58:48 -04:00
Dave Syer
618eef147f Additional tests for placeholder replacement
It turns out that the mechanism we use to convert properties
to YAML (and JSON) means that placeholders are always replaced
if there are defaults (e.g. ${foo:bar} always resolves to "bar"
if "foo" is undefined).

This seems soprt of reasonable, if a little surprising. We could
change the way YAML and JSON are generated, but that would be
a big deal, and probably not worth the effort to fix a bit of
slightly surprising behaviour.
2016-08-22 09:35:34 +01:00
Dave Syer
f8fc4e1937 Omit system properties and env vars from placeholders in config
When replacing placeholders in the .yml, .properties and .json
endpoints, only the properties from the config repo (not the
local system and environment variables) ought to be included.
2016-08-22 08:56:18 +01:00
Dave Syer
80fc022dda Merge branch '1.1.x' 2016-08-16 12:30:17 +01:00
Dave Syer
3e6231a61d Slightly less bizarre implementation of convertToProperties()
The EnvironmentController has to convert an Environment to
Properties in a few places. We have had issues in the past
with inconsistent behaviour for arrays (e.g. a.b[0], a.b[1])
defined and overridden in more than one property source. The
fix for those issues created other problems because too many
of the other properties in the property source that overrides
an array were carried over into the final result.

Fixes gh-441
2016-08-16 12:29:20 +01:00
Marcos Barbero
218d140c7e Add force-pull flag for dirty repositories
fixes gh-430
2016-08-10 13:23:05 -06:00
Spencer Gibb
121dbefd01 Make {label} placeholder behavior consistent.
Use the default label if the {label} placeholder is in the git uri, but the supplied label is null.

fixes gh-470
2016-08-09 09:12:19 -06:00
Ryan Baxter
1f0bbddc54 Protects from NPE when no data returned from Vault. Fixes #445. 2016-07-19 09:35:59 -04:00
Spencer Gibb
753db0ed22 Implement VaultEnvironmentRepository.
This is an alternative to VCS or file based repository implementations.

All properties are stored ecrypted in vault, regardless of whether or
not that actaully need to be encrypted.

Supports properties style (this.is.a.property) or vault nested
properties.

Adds a watch to client and server, if enabled, the client will long poll
the server and wait for changes rather than relying on a message broker
to send change events.

Adds a server side watch for consul keys, this is useful when vault is
backed by consul (and currently the only use case, since there is not a
consul repository implementation).

Closes gh-397
2016-07-01 11:29:29 -06:00
Matt Benson
c57b5c4e5c using array index properties, e.g. YAML arrays
(at least with a single element), causes the existing array value
to be modified; guard the static array from accidental modification

Fixes gh-422
2016-06-22 09:00:43 +01:00
Dave Syer
c0b148e370 Consult defaultLabel before generating actual config properties
Fixes gh-414
2016-06-11 10:51:02 +01:00
sprgn
eb6ff9840b Added subversion fallback to working copy.
Fallback to working copy of already checkedout repo when/if subversion server becomes unavailable.  Similar functionality alreay exists with git repository.
2016-06-03 14:32:19 -06:00
Daniel Frey
2323878eaa Added override handling of arrays/maps in properties and yaml endpoints
fixes #385
2016-06-01 13:05:46 +01:00
Dave Syer
7430e7deda Make the startup of application context quieter
Every app that requests config from the server starts a mini
application context. We can make it a bit less verbose by
shutting off the startup info logger in the SpringApplication.
2016-06-01 11:41:31 +01:00
Iván Corrales
ba303fd0aa Support for applications with hyphen in name
Formerly the .properties, .json and .yml endpoints did not accept
requests for application names with hyphens. This change makes
hyphens legal in application names, but still illegal in profile
names (you have to pick one).

Fixes gh-384
2016-05-24 09:08:51 +01:00
Dave Syer
984cc5b885 Fix bug in request handling
For some reason path info is always null(?), so the way to get the
resource path is to use request.getRequestURI().
2016-05-03 09:12:25 +01:00
Spencer Gibb
95a7532092 polish 2016-05-02 11:00:12 -06:00
Dave Syer
a121668b92 Simpler handling of request path matching
The residual path can easily be dug out of the request using
substring, so that seems simpler.
2016-04-26 12:31:02 +01:00
Matt Benson
477ee0d42a Allow ResourceController to handle resource paths of arbitrary depth
File paths with slashes seem reasonable, so this change adds support
for those. Unfortunately, but unavoidably this requires some
manipulation of the servlet request, until changes can be made in
Spring MVC. See https://jira.spring.io/browse/SPR-14193.

Fixes gh-376
2016-04-26 12:30:54 +01:00
Dave Syer
be30d54954 Make test whitespace independent (for windoze) 2016-04-19 13:49:22 +01:00