Commit Graph

73 Commits

Author SHA1 Message Date
Spencer Gibb
80b91d0a03 fix merge error 2017-06-30 19:33:31 -06:00
Spencer Gibb
c44c3f37e4 Merge branch 'master' into 2.0.x
# Conflicts:
#	spring-cloud-context/src/main/java/org/springframework/cloud/autoconfigure/LifecycleMvcEndpointAutoConfiguration.java
#	spring-cloud-context/src/test/java/org/springframework/cloud/autoconfigure/RefreshAutoConfigurationClassPathTests.java
#	spring-cloud-context/src/test/java/org/springframework/cloud/autoconfigure/RefreshAutoConfigurationTests.java
2017-06-30 18:14:37 -06:00
Spencer Gibb
c75673110b formatting 2017-06-30 17:47:08 -06:00
Fabio Matos
2e81db24cf Disables endpoint creation (#208)
Fixes gh-117
2017-06-30 19:38:03 -04:00
Spencer Gibb
853d7c43a7 Comment out broken tests 2017-05-31 14:18:05 -06:00
Spencer Gibb
ebf4112116 Updates to boot 2.0 changes 2017-05-16 13:23:21 -06:00
Dave Syer
3f005ab238 Update to fix issues introduced in Boot 2.0.0.M1 2017-05-16 18:16:14 +01:00
Dave Syer
021a77d997 Uningnored some tests to do with binding to lists
See https://github.com/spring-projects/spring-boot/issues/9137
2017-05-14 11:06:37 +01:00
Dave Syer
d030225d46 Split out ModifiedClassPathRunner into a separate jar 2017-05-12 11:05:17 +01:00
Dave Syer
c3f9b1a821 Fix more Spring Boot related mayhem 2017-05-12 10:42:06 +01:00
Dave Syer
4b4e7650fa Switch to new class loader filter runner 2017-05-12 10:42:06 +01:00
Dave Syer
1850155bad Add link to comment 2017-05-11 12:03:39 +01:00
Dave Syer
f191110228 Hack the configuration properties to fix tests
See https://github.com/spring-projects/spring-boot/issues/9160
2017-05-11 11:34:24 +01:00
Dave Syer
80555b3354 Updates to adapt to Spring Boot changes
Also adjusts bootstrap listener to be smarter about default
properties:

It's better not to use the default properties at all because the
user might pass some in and we don't want to overwrite them. Before
Boot 2.0 we got away with it, but since 2.0 we have to be more
cautious.
2017-05-09 07:01:46 +01:00
Spencer Gibb
ac16a94880 comment out broken test 2017-05-01 10:25:55 -06:00
Spencer Gibb
922608651a fix test path 2017-05-01 09:27:37 -06:00
Spencer Gibb
6a4789a691 Update to new binder 2017-05-01 08:58:28 -06:00
Spencer Gibb
b40ceef356 RefreshEventListener no longer depends on RefreshEndpoint.
Instead it depends on ContextRefresher with actually does the work.

This allows applications to use the listener even if they don't depend
on actuator.

fixes gh-171
2017-04-03 20:13:11 -06:00
Spencer Gibb
78d10fc223 Use relaxed property resolver in KeyCondition
Allows users to define properties like encrypt.key-store.password=letmein

fixes gh-191

(cherry picked from commit 7744b63)
2017-04-03 19:52:17 -06:00
Spencer Gibb
1eddbc125b fix compile errors in tests 2017-03-15 12:08:04 -06:00
Dave Syer
45b0c078eb Merge branch '1.1.x' 2017-03-15 12:18:14 +00:00
Dave Syer
ba281228f6 Apply bootstrap initializers to all contexts in a hierarchy
The fix for gh-153 was sensible, but has now exposed another issue
which is that the bootstrap initializers, whilst they are now only
created once, actually only get applied to the parent context
in a hierarchy.

Most of the time this doesn't matter because the child contexts all
benefit from environment changes and additional beans added
to the parent. If the children are supposed to actually have
different environments, though, there is a problem. So this change
locates the existing bootstrap context and applies it to each
new context created separately.

Unfortunately we have to use reflection to do that for now because
there is no way to discover the parent with a public API before
the context is refreshed.

See gh-190
2017-03-15 12:16:32 +00:00
Dave Syer
70d601df84 Register a BeanDefinition manually instead of using @Bean
For RefreshScope this stops Spring from moaning about the @Bean
method with a WARN log (which is benign but hard to get rid of
and confusing for users).

See gh-401
2017-03-15 12:15:51 +00:00
Spencer Gibb
1865bc6306 polish 2017-03-01 10:43:01 -07:00
Biju Kunjummen
4e0d2e520f Fixes possible infinite loop
Fixes edge case of an infinite loop in decrypting properties in a hierarchy of application contexts.


fixes gh-178
2017-03-01 12:41:00 -05:00
Dave Syer
d2ab1c6de9 Merge branch '1.1.x' 2017-02-24 09:42:36 +00:00
Dave Syer
331e790026 Ensure there is a single bootstrap parent context
Only one neds to be created, and once it is in place in the hierarchy
it should be usable by all the child contexts that get added.

Fixes gh-153
2017-02-24 09:38:30 +00:00
Spencer Gibb
dcaef01b27 Update to boot 1.5 test classes 2017-02-21 08:19:24 -07:00
Dave Syer
d5a63c988d Merge branch '1.1.x' 2017-02-21 10:18:29 +00:00
Dave Syer
8347c5741c Extract target from @ConfigurationProperties proxy
Fixes gh-175 (more of a workaround really and gh-177 is still open
to track further changes).
2017-02-21 10:01:05 +00:00
Spencer Gibb
a86356327c fix tests for boot 1.4.x 2017-02-14 14:23:27 -07:00
Spencer Gibb
5b8ae3a96a Make sure bootstrap sources are ordered before use.
Make call to sort() before setting on builder.sources().

fixes gh-176

(cherry picked from commit 6dc35d1)
2017-02-14 14:18:48 -07:00
Spencer Gibb
6dc35d1edc Make sure bootstrap sources are ordered before use.
Make call to sort() before setting on builder.sources().

fixes gh-176
2017-02-14 14:17:11 -07:00
Matt Benson
941275ded2 consider spring.profiles.include values from bootstrap PropertySources (#123) 2017-01-26 12:14:43 -05:00
Spencer Gibb
210c7b9017 Update spring-cloud-build to 1.3.1.BUILD-SNAPSHOT 2017-01-09 18:25:48 -07:00
Matthew Reid
63e4e3b8d6 Allow lifecycle endpoints to be globally disabled using endpoints.enabled property (#148)
fixes gh-158
2017-01-09 14:37:48 -05:00
Anders Båtstrand
69192f6f67 Exposing context names, fixes https://github.com/spring-cloud/spring-cloud-netflix/issues/1585. 2017-01-04 11:00:51 +01:00
Spencer Gibb
e13764db66 Fixes indexed properties merging problem.
Given the following in one property source
```
mine[0].someValue=Foo
mine[0].someKey={cipher}XXXX
mine[1].someValue=Bar
mine[1].someKey={cipher}XXXX
yours[0].anotherKey=Baz
```
only `mine[*].someKey` were added to "decrypted" property source. Due to house spring boot manages indexed properties, they can not be merged across property source. This change includes all indexed properties in the "decrypted" property source if any one of them is encrypted.

In the above example, `yours[*].*` is included even though unrelated.

fixes gh-466
2016-09-09 14:23:19 -06:00
Dave Syer
31a2b3ea0e Make some tests more robust so they pass with BOot 1.4 as well
A couple of tests here make assumptions about the property source
names added using @IntegrationTest. If we are a bit more defensive
and search for a source with a matching name instead of grabbing
one by the precise name, we can have tests that pass in Boot 1.3
and 1.4.
2016-05-05 14:05:46 +01:00
Dave Syer
b54c8e80e8 Add support for endpoints.env.post.enabled=false
Separately disable the POST /env from the GET. Fixes gh-106.
2016-04-18 10:04:56 +01:00
Venil Noronha
b92016b260 Moved RefreshEndpoint logic to ContextRefresher.
Fixes gh-101
2016-04-01 15:03:30 -06:00
Dave Syer
7eccbc4bac Make LoggingRebinder case insensitive
Partly to account for the fact that Sprng Boot publishes config
meta data with lower case values (don't ask).
2016-03-04 09:22:03 +00:00
Dave Syer
1c430d4ff3 Add test for serialization ID in RefreshScope
It should be unique and deterministic by default.
2016-02-29 13:57:37 +00:00
Spencer Gibb
86ff712398 Properly close child contexts in destroy()
fixes gh-91
2016-02-22 10:49:54 -07:00
Dave Syer
624be9d19e Fix ordering of property sources
When the bootstrap properties are added back into the main Environment
we have to be careful that any source that is already there (such as
one that was added in a Spring Boot EnvironmentPostProcessor) is not
replaced in the wrong order.

Fixes gh-90
2016-02-15 10:25:19 +00:00
tc
bcb4e60448 Fix property source for decrypted variables
Use SystemEnvironmentPropertySource so that env vars can be
encrypted as well as property values (i.e. FOO_BAR will bind to
@Value("foo.bar")).

Fixes gh-89, fixes gh-87
2016-02-11 14:46:26 +00:00
Spencer Gibb
8a21f71ad1 Reuse pause and resume endpoints to the can be disabled.
fixes gh-86
2016-02-03 12:38:28 -07:00
Dave Syer
9c6aeba780 Ensure spring.main.sources is not used in refresh cycle
When the RefreshEndpoint makes a new Environment it creates a new
ApplicationContext with (hopefully) empty sources. If the user has
set spring.main.sources it won't be empty, so we should take care
to mask it off in the process.

Fixes gh-79
2016-02-02 21:55:19 +00:00
Dave Syer
6f463ad10d Add RefreshScopeHealthIndicator
Repots DOWN if there are errors in RefreshScope or
ConfigurationProperties rebinding, N.B. RefreshScope instantiates
its beans lazily after a refresh by default, so you won't see an
error until the bean is used.

Fixes gh-85
2016-02-02 17:28:52 +00:00
Dave Syer
5cfe42b9af Fix careless mistake in tests 2016-02-01 13:26:21 +00:00