Skip to content

Commit 000c37a

Browse files
authored
Merge pull request #67 from ContainerSolutions/spring-boot-support-remove-and-sample
removed spring boot support, added spring boot sample
2 parents 305d6e7 + cff8b86 commit 000c37a

File tree

17 files changed

+46
-398
lines changed

17 files changed

+46
-398
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ The Controller only contains the logic to create, update and delete the actual r
1111

1212
Feature we would like to implement and invite the community to help us implement in the future:
1313

14-
* ~~Spring Boot support~~
15-
* Testing support
14+
* ~~Spring Boot sample~~
1615
* Class generation from CRD to POJO
16+
* Quarkus support
1717

1818
## Usage
1919

pom.xml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636

3737
<modules>
3838
<module>operator-framework</module>
39-
<module>spring-boot-starter</module>
4039
<module>samples</module>
4140
</modules>
4241

@@ -50,7 +49,7 @@
5049
<dependency>
5150
<groupId>io.fabric8</groupId>
5251
<artifactId>openshift-client</artifactId>
53-
<version>4.7.1</version>
52+
<version>4.9.0</version>
5453
</dependency>
5554
<dependency>
5655
<groupId>org.apache.commons</groupId>
@@ -79,12 +78,6 @@
7978
<version>3.0.0</version>
8079
<scope>test</scope>
8180
</dependency>
82-
<dependency>
83-
<groupId>org.springframework</groupId>
84-
<artifactId>spring-core</artifactId>
85-
<version>5.1.8.RELEASE</version>
86-
<scope>compile</scope>
87-
</dependency>
8881
</dependencies>
8982
</dependencyManagement>
9083

@@ -100,7 +93,7 @@
10093
<plugin>
10194
<groupId>org.apache.maven.plugins</groupId>
10295
<artifactId>maven-surefire-plugin</artifactId>
103-
<!--<version>2.19.1</version> -->
96+
<version>2.22.2</version>
10497
<configuration>
10598
<includes>
10699
<include>**/*IT.java</include>

samples/basic/spring-boot/pom.xml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,16 @@
2525
<groupId>com.github.containersolutions</groupId>
2626
<artifactId>operator-framework-samples-common</artifactId>
2727
<version>${project.version}</version>
28+
<exclusions>
29+
<exclusion>
30+
<groupId>org.apache.logging.log4j</groupId>
31+
<artifactId>log4j-slf4j-impl</artifactId>
32+
</exclusion>
33+
</exclusions>
2834
</dependency>
2935
<dependency>
30-
<groupId>com.github.containersolutions</groupId>
31-
<artifactId>spring-boot-operator-framework-starter</artifactId>
32-
<version>${project.version}</version>
36+
<groupId>org.springframework.boot</groupId>
37+
<artifactId>spring-boot-starter</artifactId>
3338
</dependency>
3439
</dependencies>
3540

@@ -38,7 +43,7 @@
3843
<dependency>
3944
<groupId>org.springframework.boot</groupId>
4045
<artifactId>spring-boot-dependencies</artifactId>
41-
<version>2.1.6.RELEASE</version>
46+
<version>2.2.6.RELEASE</version>
4247
<type>pom</type>
4348
<scope>import</scope>
4449
</dependency>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.github.containersolutions.operator.sample;
2+
3+
import com.github.containersolutions.operator.Operator;
4+
import com.github.containersolutions.operator.api.ResourceController;
5+
import io.fabric8.kubernetes.client.DefaultKubernetesClient;
6+
import io.fabric8.kubernetes.client.KubernetesClient;
7+
import org.springframework.context.annotation.Bean;
8+
import org.springframework.context.annotation.Configuration;
9+
10+
import java.util.List;
11+
12+
@Configuration
13+
public class Config {
14+
15+
@Bean
16+
public KubernetesClient kubernetesClient() {
17+
return new DefaultKubernetesClient();
18+
}
19+
20+
@Bean
21+
public CustomServiceController customServiceController(KubernetesClient client) {
22+
return new CustomServiceController(client);
23+
}
24+
25+
// Register all controller beans
26+
@Bean
27+
public Operator operator(KubernetesClient client, List<ResourceController> controllers) {
28+
Operator operator = new Operator(client);
29+
controllers.forEach(c -> operator.registerController(c));
30+
return operator;
31+
}
32+
33+
}

samples/basic/spring-boot/src/main/java/com/github/containersolutions/operator/sample/SampleComponent.java

Lines changed: 0 additions & 34 deletions
This file was deleted.

samples/basic/spring-boot/src/main/java/com/github/containersolutions/operator/sample/SpringBootStarterSampleApplication.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
package com.github.containersolutions.operator.sample;
22

3-
import com.github.containersolutions.operator.api.Controller;
43
import org.springframework.boot.SpringApplication;
54
import org.springframework.boot.autoconfigure.SpringBootApplication;
6-
import org.springframework.context.annotation.ComponentScan;
7-
import org.springframework.context.annotation.FilterType;
85

9-
/**
10-
* Note that we have multiple options here either we can add this component scan as seen below. Or annotate controllers
11-
* with @Component or @Service annotation or just register the bean within a spring "@Configuration".
12-
*/
13-
@ComponentScan(includeFilters = {@ComponentScan.Filter(type = FilterType.ANNOTATION, value = Controller.class)})
146
@SpringBootApplication
157
public class SpringBootStarterSampleApplication {
168

spring-boot-starter/pom.xml

Lines changed: 0 additions & 97 deletions
This file was deleted.

spring-boot-starter/src/main/java/com/github/containersolutions/operator/spingboot/starter/OperatorAutoConfiguration.java

Lines changed: 0 additions & 67 deletions
This file was deleted.

spring-boot-starter/src/main/java/com/github/containersolutions/operator/spingboot/starter/OperatorProperties.java

Lines changed: 0 additions & 58 deletions
This file was deleted.

spring-boot-starter/src/main/resources/META-INF/spring.factories

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)