Skip to content
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
merged 36 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
bf7b971
first
wind57 Jun 11, 2022
cf4fca4
more changes
wind57 Jun 12, 2022
0ace7cd
fix test
wind57 Jun 12, 2022
923895f
fix test
wind57 Jun 12, 2022
6379ed9
make both final
wind57 Jun 12, 2022
ad85d11
first
wind57 Jun 12, 2022
c99f760
more clean-up
wind57 Jun 12, 2022
36e1bae
some simplifications
wind57 Jun 12, 2022
e3725f5
same logging
wind57 Jun 12, 2022
9face5a
Merge branch 'reload-conditionals-nitpick' into reload-conditionals-n…
wind57 Jun 12, 2022
1eefcb9
more clean-up, still I am in the blur a little
wind57 Jun 14, 2022
f60830a
clean-up
wind57 Jun 14, 2022
9f953ab
clean-up part 4
wind57 Jun 15, 2022
d148d2f
configmap polling test added
wind57 Jun 15, 2022
2a5da4c
informers + tests
wind57 Jun 16, 2022
940efcc
k8s native changes + tests
wind57 Jun 16, 2022
eba2c9f
fix tests
wind57 Jun 16, 2022
af8dc00
fix tests take 2
wind57 Jun 16, 2022
d7164dc
fix tests take 3
wind57 Jun 16, 2022
66b1e6a
fix tests take 4
wind57 Jun 16, 2022
4f08bed
merge previous
wind57 Jun 16, 2022
db6043c
fix test
wind57 Jun 16, 2022
623bac6
merge main
wind57 Jun 17, 2022
587a2cc
Merge branch 'reload-conditionals-nitpick-2' into reload-simplify-con…
wind57 Jun 17, 2022
f5487ae
merge previous
wind57 Jun 17, 2022
c648adf
dirty
wind57 Jul 4, 2022
63d34d9
started merging
wind57 Jul 4, 2022
69af4b1
fabric8 polish
wind57 Jul 4, 2022
83a60be
license
wind57 Jul 4, 2022
8410306
log added
wind57 Jul 4, 2022
8f919c9
inform
wind57 Jul 4, 2022
61507aa
informers commented
wind57 Jul 4, 2022
4a47895
k8s native
wind57 Jul 4, 2022
7886338
more
wind57 Jul 4, 2022
eaf5938
2 minutes
wind57 Jul 4, 2022
0ffbb3d
give more time
wind57 Jul 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
configmap polling test added
  • Loading branch information
wind57 committed Jun 15, 2022
commit d148d2fb9a611a035bd4d56da4cdca500d52e7c5
1 change: 1 addition & 0 deletions spring-cloud-kubernetes-integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,6 @@
<module>spring-cloud-kubernetes-client-reactive-discoveryclient-it</module>
<module>spring-cloud-kubernetes-configuration-watcher-it</module>
<module>spring-cloud-kubernetes-core-k8s-client-it</module>
<module>spring-cloud-kubernetes-fabric8-client-configmap-polling-reload</module>
Copy link
Contributor Author

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

</modules>
</project>
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>
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);
}

}
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();
}

}
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;
}

}
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

Loading