Update SNAPSHOT to 1.0.2.RELEASE

This commit is contained in:
buildmaster
2019-06-20 17:01:52 +00:00
parent 4a73d4e6dd
commit e529dc94c2
34 changed files with 96 additions and 44 deletions

View File

@@ -324,6 +324,59 @@ However, if the `production` profile is active, the configuration becomes:
If both profiles are active, the property that appears last within the `ConfigMap` overwrites any preceding values.
Another option is to create a different config map per profile and spring boot will automatically fetch it based
on active profiles
====
[source,yaml]
----
kind: ConfigMap
apiVersion: v1
metadata:
name: demo
data:
application.yml: |-
greeting:
message: Say Hello to the World
farewell:
message: Say Goodbye
----
====
====
[source,yaml]
----
kind: ConfigMap
apiVersion: v1
metadata:
name: demo-development
data:
application.yml: |-
spring:
profiles: development
greeting:
message: Say Hello to the Developers
farewell:
message: Say Goodbye to the Developers
----
====
====
[source,yaml]
----
kind: ConfigMap
apiVersion: v1
metadata:
name: demo-production
data:
application.yml: |-
spring:
profiles: production
greeting:
message: Say Hello to the Ops
farewell:
message: Say Goodbye
----
====
To tell Spring Boot which `profile` should be enabled at bootstrap, you can pass a system property to the Java
command. To do so, you can launch your Spring Boot application with an environment variable that you can define with the OpenShift

View File

@@ -8,7 +8,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-kubernetes</artifactId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<packaging>pom</packaging>
<name>Spring Cloud Kubernetes Docs</name>

10
pom.xml
View File

@@ -24,13 +24,13 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-build</artifactId>
<version>2.1.4.BUILD-SNAPSHOT</version>
<version>2.1.5.RELEASE</version>
<relativePath/>
</parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-kubernetes</artifactId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
<packaging>pom</packaging>
<name>Spring Cloud Kubernetes</name>
@@ -63,9 +63,9 @@
<properties>
<!-- Dependency Versions -->
<spring-cloud-commons.version>2.1.2.BUILD-SNAPSHOT</spring-cloud-commons.version>
<spring-cloud-netflix.version>2.1.2.BUILD-SNAPSHOT</spring-cloud-netflix.version>
<spring-cloud-config.version>2.1.2.BUILD-SNAPSHOT</spring-cloud-config.version>
<spring-cloud-commons.version>2.1.2.RELEASE</spring-cloud-commons.version>
<spring-cloud-netflix.version>2.1.2.RELEASE</spring-cloud-netflix.version>
<spring-cloud-config.version>2.1.3.RELEASE</spring-cloud-config.version>
<!-- Maven Plugin Versions -->
<maven-compiler-plugin.version>3.5</maven-compiler-plugin.version>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>spring-cloud-kubernetes</artifactId>
<groupId>org.springframework.cloud</groupId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -99,16 +99,18 @@ public class ConfigMapPropertySource extends MapPropertySource {
}
if (environment != null) {
for (String activeProfile:environment.getActiveProfiles()) {
for (String activeProfile : environment.getActiveProfiles()) {
String mapNameWithProfile = name + "-" + activeProfile;
ConfigMap mapWithProfile = StringUtils.isEmpty(namespace)
? client.configMaps().withName(mapNameWithProfile).get()
: client.configMaps().inNamespace(namespace).withName(mapNameWithProfile).get();
? client.configMaps().withName(mapNameWithProfile).get()
: client.configMaps().inNamespace(namespace)
.withName(mapNameWithProfile).get();
if (mapWithProfile != null) {
result.putAll(processAllEntries(mapWithProfile.getData(), environment));
result.putAll(
processAllEntries(mapWithProfile.getData(), environment));
}
}
@@ -125,7 +127,6 @@ public class ConfigMapPropertySource extends MapPropertySource {
return new HashMap<>();
}
private static Map<String, String> processAllEntries(Map<String, String> input,
Environment environment) {

View File

@@ -22,7 +22,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-kubernetes</artifactId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -23,11 +23,11 @@
<parent>
<artifactId>spring-cloud-dependencies-parent</artifactId>
<groupId>org.springframework.cloud</groupId>
<version>2.1.4.BUILD-SNAPSHOT</version>
<version>2.1.5.RELEASE</version>
<relativePath/>
</parent>
<artifactId>spring-cloud-kubernetes-dependencies</artifactId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
<packaging>pom</packaging>
<name>Spring Cloud Kubernetes :: Dependencies</name>
<description>Spring Cloud Kubernetes Dependencies</description>

View File

@@ -22,7 +22,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-kubernetes</artifactId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -23,7 +23,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>kubernetes-circuitbreaker-ribbon-example</artifactId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<artifactId>greeting-service</artifactId>

View File

@@ -23,7 +23,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>kubernetes-circuitbreaker-ribbon-example</artifactId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<artifactId>name-service</artifactId>

View File

@@ -23,7 +23,7 @@
<parent>
<artifactId>spring-cloud-kubernetes-examples</artifactId>
<groupId>org.springframework.cloud</groupId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<groupId>org.springframework.cloud</groupId>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>spring-cloud-kubernetes-examples</artifactId>
<groupId>org.springframework.cloud</groupId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-kubernetes-examples</artifactId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<artifactId>kubernetes-leader-election-example</artifactId>

View File

@@ -22,7 +22,7 @@
<parent>
<artifactId>spring-cloud-kubernetes-examples</artifactId>
<groupId>org.springframework.cloud</groupId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -22,7 +22,7 @@
<parent>
<artifactId>spring-cloud-kubernetes-examples</artifactId>
<groupId>org.springframework.cloud</groupId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -23,7 +23,7 @@
<parent>
<artifactId>spring-cloud-kubernetes</artifactId>
<groupId>org.springframework.cloud</groupId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<artifactId>spring-cloud-kubernetes-examples</artifactId>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>discovery-parent</artifactId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<artifactId>discovery-client</artifactId>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>discovery-parent</artifactId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<artifactId>discovery-service-a</artifactId>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>discovery-parent</artifactId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<artifactId>discovery-service-b</artifactId>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-kubernetes-integration-tests</artifactId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<name>Spring Cloud Kubernetes :: Integration Tests :: Discovery Parent</name>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>discovery-parent</artifactId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<artifactId>tests</artifactId>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-kubernetes-integration-tests</artifactId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<name>Spring Cloud Kubernetes :: Integration Tests :: Istio</name>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-kubernetes</artifactId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<artifactId>spring-cloud-kubernetes-integration-tests</artifactId>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-kubernetes-integration-tests</artifactId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<name>Spring Cloud Kubernetes :: Integration Tests :: Simple Configmap</name>

View File

@@ -7,7 +7,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-kubernetes-integration-tests</artifactId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<name>Spring Cloud Kubernetes :: Integration Tests :: Simple Core</name>

View File

@@ -5,7 +5,7 @@
<parent>
<artifactId>spring-cloud-kubernetes</artifactId>
<groupId>org.springframework.cloud</groupId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -22,7 +22,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-kubernetes</artifactId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<artifactId>spring-cloud-kubernetes-leader</artifactId>

View File

@@ -41,8 +41,7 @@ import org.springframework.integration.leader.event.LeaderEventPublisher;
@Configuration
@EnableConfigurationProperties(LeaderProperties.class)
@ConditionalOnBean(KubernetesClient.class)
@ConditionalOnProperty(value = "spring.cloud.kubernetes.leader.enabled",
matchIfMissing = true)
@ConditionalOnProperty(value = "spring.cloud.kubernetes.leader.enabled", matchIfMissing = true)
public class LeaderAutoConfiguration {
@Bean

View File

@@ -33,8 +33,7 @@ import static org.hamcrest.Matchers.containsString;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = {
// Make sure test passes without Kubernetes cluster
"spring.cloud.kubernetes.leader.autoStartup=false"
})
"spring.cloud.kubernetes.leader.autoStartup=false" })
public class LeaderAutoConfigurationTests {
@Value("${local.server.port}")

View File

@@ -22,7 +22,7 @@
<parent>
<artifactId>spring-cloud-kubernetes</artifactId>
<groupId>org.springframework.cloud</groupId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -22,7 +22,7 @@
<parent>
<artifactId>spring-cloud-kubernetes</artifactId>
<groupId>org.springframework.cloud</groupId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -22,7 +22,7 @@
<parent>
<artifactId>spring-cloud-kubernetes</artifactId>
<groupId>org.springframework.cloud</groupId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -22,7 +22,7 @@
<parent>
<artifactId>spring-cloud-kubernetes</artifactId>
<groupId>org.springframework.cloud</groupId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -22,7 +22,7 @@
<parent>
<artifactId>spring-cloud-kubernetes</artifactId>
<groupId>org.springframework.cloud</groupId>
<version>1.0.3.BUILD-SNAPSHOT</version>
<version>1.0.2.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>