-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reload functionality clean-up part 4 #1036
Merged
ryanjbaxter
merged 36 commits into
spring-cloud:main
from
wind57:reload-simplify-configs-part-4
Jul 7, 2022
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
bf7b971
first
wind57 cf4fca4
more changes
wind57 0ace7cd
fix test
wind57 923895f
fix test
wind57 6379ed9
make both final
wind57 ad85d11
first
wind57 c99f760
more clean-up
wind57 36e1bae
some simplifications
wind57 e3725f5
same logging
wind57 9face5a
Merge branch 'reload-conditionals-nitpick' into reload-conditionals-n…
wind57 1eefcb9
more clean-up, still I am in the blur a little
wind57 f60830a
clean-up
wind57 9f953ab
clean-up part 4
wind57 d148d2f
configmap polling test added
wind57 2a5da4c
informers + tests
wind57 940efcc
k8s native changes + tests
wind57 eba2c9f
fix tests
wind57 af8dc00
fix tests take 2
wind57 d7164dc
fix tests take 3
wind57 66b1e6a
fix tests take 4
wind57 4f08bed
merge previous
wind57 db6043c
fix test
wind57 623bac6
merge main
wind57 587a2cc
Merge branch 'reload-conditionals-nitpick-2' into reload-simplify-con…
wind57 f5487ae
merge previous
wind57 c648adf
dirty
wind57 63d34d9
started merging
wind57 69af4b1
fabric8 polish
wind57 83a60be
license
wind57 8410306
log added
wind57 8f919c9
inform
wind57 61507aa
informers commented
wind57 4a47895
k8s native
wind57 7886338
more
wind57 eaf5938
2 minutes
wind57 0ffbb3d
give more time
wind57 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
configmap polling test added
- Loading branch information
commit d148d2fb9a611a035bd4d56da4cdca500d52e7c5
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
...integration-tests/spring-cloud-kubernetes-fabric8-client-configmap-polling-reload/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-kubernetes-integration-tests</artifactId> | ||
<version>3.0.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>spring-cloud-kubernetes-fabric8-client-configmap-polling-reload</artifactId> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-kubernetes-fabric8-config</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-kubernetes-test-support</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-webflux</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-actuator</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.github.docker-java</groupId> | ||
<artifactId>docker-java-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.github.docker-java</groupId> | ||
<artifactId>docker-java-transport-httpclient5</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<resources> | ||
<resource> | ||
<directory>../src/main/resources</directory> | ||
<filtering>true</filtering> | ||
</resource> | ||
<resource> | ||
<directory>src/main/resources</directory> | ||
<filtering>true</filtering> | ||
</resource> | ||
</resources> | ||
|
||
<plugins> | ||
<!-- build image in the 'package' phase, and ignore plain tests --> | ||
<!-- via maven-surefire-plugin::skipTests --> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
<configuration> | ||
<imageName>docker.io/springcloud/${project.artifactId}:${project.version}</imageName> | ||
<imageBuilder>paketobuildpacks/builder</imageBuilder> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>build-image</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<!-- ignore plain tests (in the 'test' phase), so that we could build the image first, see above --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<skipTests>true</skipTests> | ||
</configuration> | ||
</plugin> | ||
|
||
<!-- run tests in the 'integration-tests' phase, one that is after 'package' (where we build the image) --> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>integration-test</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<includes> | ||
<include>${testsToRun}</include> | ||
</includes> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
|
||
</build> | ||
|
||
</project> |
35 changes: 35 additions & 0 deletions
35
...a/org/springframework/cloud/kubernetes/fabric8/configmap/polling/reload/ConfigMapApp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright 2013-2022 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.springframework.cloud.kubernetes.fabric8.configmap.polling.reload; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
|
||
/** | ||
* @author wind57 | ||
*/ | ||
|
||
@SpringBootApplication | ||
@EnableConfigurationProperties(ConfigMapProperties.class) | ||
public class ConfigMapApp { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(ConfigMapApp.class, args); | ||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
...pringframework/cloud/kubernetes/fabric8/configmap/polling/reload/ConfigMapController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright 2013-2021 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.springframework.cloud.kubernetes.fabric8.configmap.polling.reload; | ||
|
||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
/** | ||
* @author wind57 | ||
*/ | ||
@RestController | ||
public class ConfigMapController { | ||
|
||
private final ConfigMapProperties properties; | ||
|
||
public ConfigMapController(ConfigMapProperties properties) { | ||
this.properties = properties; | ||
} | ||
|
||
@GetMapping("/key") | ||
public String key() { | ||
return properties.getKey(); | ||
} | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
...pringframework/cloud/kubernetes/fabric8/configmap/polling/reload/ConfigMapProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2013-2021 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.springframework.cloud.kubernetes.fabric8.configmap.polling.reload; | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
|
||
/** | ||
* @author wind57 | ||
*/ | ||
@ConfigurationProperties("from.yaml") | ||
public class ConfigMapProperties { | ||
|
||
private String key; | ||
|
||
public String getKey() { | ||
return key; | ||
} | ||
|
||
public void setKey(String key1) { | ||
this.key = key1; | ||
} | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
...ud-kubernetes-fabric8-client-configmap-polling-reload/src/main/resources/application.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
logging: | ||
level: | ||
root: DEBUG | ||
|
||
spring: | ||
application: | ||
name: poll-reload | ||
config: | ||
import: "kubernetes:" | ||
cloud: | ||
kubernetes: | ||
reload: | ||
enabled: true | ||
monitoring-config-maps: true | ||
strategy: shutdown | ||
mode: polling | ||
period: 5000 | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added 3 more integration tests