Skip to content

Commit 0f00d96

Browse files
authored
Migrate to QOSDK (#36)
Signed-off-by: Attila Mészáros <[email protected]>
1 parent d45ebbe commit 0f00d96

File tree

12 files changed

+463
-374
lines changed

12 files changed

+463
-374
lines changed

Diff for: .github/workflows/pr.yml

-7
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ jobs:
3737
java: [ 17 ]
3838
kubernetes: [ 'v1.26.12', 'v1.27.9', 'v1.28.5' ]
3939
steps:
40-
- name: Set up Minikube
41-
uses: manusa/[email protected]
42-
with:
43-
minikube version: v1.31.2
44-
kubernetes version: ${{ matrix.kubernetes }}
45-
driver: 'docker'
46-
github token: ${{ secrets.GITHUB_TOKEN }}
4740
- uses: actions/checkout@v4
4841
- name: Set up Java and Maven
4942
uses: actions/setup-java@v4

Diff for: pom.xml

+118-57
Original file line numberDiff line numberDiff line change
@@ -10,114 +10,133 @@
1010
<name>Resource Flow Operator</name>
1111
<packaging>jar</packaging>
1212

13+
<!-- TODO remove -->
14+
<repositories>
15+
<repository>
16+
<id>snapshots-repo</id>
17+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
18+
<releases>
19+
<enabled>false</enabled>
20+
</releases>
21+
<snapshots>
22+
<enabled>true</enabled>
23+
</snapshots>
24+
</repository>
25+
</repositories>
26+
1327
<properties>
1428
<java.version>17</java.version>
1529
<maven.compiler.release>17</maven.compiler.release>
1630
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1731
<maven.compiler.source>${java.version}</maven.compiler.source>
1832
<maven.compiler.target>${java.version}</maven.compiler.target>
19-
<josdk.version>4.8.2</josdk.version>
20-
<slf4j.version>1.7.36</slf4j.version>
21-
<junit.version>5.10.2</junit.version>
22-
<log4j.version>2.23.1</log4j.version>
33+
<surefire-plugin.version>3.2.5</surefire-plugin.version>
2334
<fabric8-client.version>6.11.0</fabric8-client.version>
2435
<directory-maven-plugin.version>1.0</directory-maven-plugin.version>
2536
<impsort-maven-plugin.version>1.9.0</impsort-maven-plugin.version>
2637
<formatter-maven-plugin.version>2.23.0</formatter-maven-plugin.version>
27-
<graalvm.version>23.0.3</graalvm.version>
38+
<graalvm.version>24.0.0</graalvm.version>
2839
<mokito.version>5.11.0</mokito.version>
2940
<mustache.version>0.9.11</mustache.version>
41+
<qosdk.version>6.6.7</qosdk.version>
42+
<assertj.version>3.25.3</assertj.version>
3043
</properties>
3144

32-
<!-- <dependencyManagement>-->
33-
<!-- <dependencies>-->
34-
<!-- <dependency>-->
35-
<!-- <groupId>io.javaoperatorsdk</groupId>-->
36-
<!-- <artifactId>operator-framework-bom</artifactId>-->
37-
<!-- <version>${josdk.version}</version>-->
38-
<!-- <type>pom</type>-->
39-
<!-- <scope>import</scope>-->
40-
<!-- </dependency>-->
41-
<!-- </dependencies>-->
42-
<!-- </dependencyManagement>-->
45+
<dependencyManagement>
46+
<dependencies>
47+
<dependency>
48+
<groupId>io.fabric8</groupId>
49+
<artifactId>kubernetes-client-bom</artifactId>
50+
<version>${fabric8-client.version}</version>
51+
<type>pom</type>
52+
<scope>import</scope>
53+
</dependency>
54+
<dependency>
55+
<groupId>io.quarkiverse.operatorsdk</groupId>
56+
<artifactId>quarkus-operator-sdk-bom</artifactId>
57+
<version>${qosdk.version}</version>
58+
<scope>import</scope>
59+
<type>pom</type>
60+
</dependency>
61+
</dependencies>
62+
</dependencyManagement>
4363

4464
<dependencies>
4565
<dependency>
46-
<groupId>io.fabric8</groupId>
47-
<artifactId>kubernetes-client</artifactId>
48-
<version>${fabric8-client.version}</version>
49-
</dependency>
50-
<dependency>
51-
<groupId>io.javaoperatorsdk</groupId>
52-
<artifactId>operator-framework</artifactId>
53-
<version>${josdk.version}</version>
66+
<groupId>io.quarkiverse.operatorsdk</groupId>
67+
<artifactId>quarkus-operator-sdk</artifactId>
5468
</dependency>
5569
<dependency>
56-
<groupId>io.fabric8</groupId>
57-
<artifactId>generator-annotations</artifactId>
58-
<version>${fabric8-client.version}</version>
70+
<groupId>io.quarkiverse.operatorsdk</groupId>
71+
<artifactId>quarkus-operator-sdk-bundle-generator</artifactId>
5972
</dependency>
6073
<dependency>
61-
<groupId>io.fabric8</groupId>
62-
<artifactId>crd-generator-apt</artifactId>
63-
<version>${fabric8-client.version}</version>
64-
<scope>provided</scope>
74+
<groupId>io.quarkus</groupId>
75+
<artifactId>quarkus-junit5</artifactId>
76+
<scope>test</scope>
6577
</dependency>
6678
<dependency>
67-
<groupId>io.javaoperatorsdk</groupId>
68-
<artifactId>operator-framework-junit-5</artifactId>
69-
<version>${josdk.version}</version>
79+
<groupId>io.quarkus</groupId>
80+
<artifactId>quarkus-junit5-mockito</artifactId>
7081
<scope>test</scope>
7182
</dependency>
7283
<dependency>
73-
<groupId>org.slf4j</groupId>
74-
<artifactId>slf4j-api</artifactId>
75-
<version>${slf4j.version}</version>
84+
<groupId>org.jboss.slf4j</groupId>
85+
<artifactId>slf4j-jboss-logmanager</artifactId>
7686
</dependency>
7787
<dependency>
78-
<groupId>org.apache.logging.log4j</groupId>
79-
<artifactId>log4j-slf4j-impl</artifactId>
80-
<version>${log4j.version}</version>
88+
<groupId>io.fabric8</groupId>
89+
<artifactId>generator-annotations</artifactId>
90+
<version>${fabric8-client.version}</version>
8191
</dependency>
8292
<dependency>
83-
<groupId>org.apache.logging.log4j</groupId>
84-
<artifactId>log4j-core</artifactId>
85-
<version>${log4j.version}</version>
93+
<groupId>org.awaitility</groupId>
94+
<artifactId>awaitility</artifactId>
95+
<scope>test</scope>
8696
</dependency>
8797
<dependency>
88-
<groupId>org.junit.jupiter</groupId>
89-
<artifactId>junit-jupiter-api</artifactId>
98+
<groupId>org.assertj</groupId>
99+
<artifactId>assertj-core</artifactId>
100+
<version>${assertj.version}</version>
90101
<scope>test</scope>
91-
<version>${junit.version}</version>
92102
</dependency>
93103
<dependency>
94-
<groupId>org.junit.jupiter</groupId>
95-
<artifactId>junit-jupiter-engine</artifactId>
96-
<scope>test</scope>
97-
<version>${junit.version}</version>
104+
<groupId>io.quarkus</groupId>
105+
<artifactId>quarkus-container-image-jib</artifactId>
98106
</dependency>
99107
<dependency>
100-
<groupId>org.mockito</groupId>
101-
<artifactId>mockito-core</artifactId>
102-
<version>${mokito.version}</version>
103-
<scope>test</scope>
108+
<groupId>org.graalvm.polyglot</groupId>
109+
<artifactId>polyglot</artifactId>
110+
<version>${graalvm.version}</version>
104111
</dependency>
105112
<dependency>
106113
<groupId>org.graalvm.js</groupId>
107114
<artifactId>js-scriptengine</artifactId>
108115
<version>${graalvm.version}</version>
109116
</dependency>
110117
<dependency>
111-
<groupId>org.graalvm.js</groupId>
112-
<artifactId>js</artifactId>
118+
<groupId>org.graalvm.polyglot</groupId>
119+
<artifactId>js-community</artifactId>
113120
<version>${graalvm.version}</version>
121+
<type>pom</type>
114122
<scope>runtime</scope>
115123
</dependency>
116124
<dependency>
117125
<groupId>com.github.spullara.mustache.java</groupId>
118126
<artifactId>compiler</artifactId>
119127
<version>${mustache.version}</version>
120128
</dependency>
129+
<dependency>
130+
<groupId>org.bouncycastle</groupId>
131+
<artifactId>bcpkix-jdk18on</artifactId>
132+
<optional>true</optional>
133+
</dependency>
134+
<dependency>
135+
<groupId>io.fabric8</groupId>
136+
<artifactId>crd-generator-apt</artifactId>
137+
<scope>test</scope>
138+
<version>${fabric8-client.version}</version>
139+
</dependency>
121140
</dependencies>
122141

123142
<build>
@@ -146,6 +165,47 @@
146165
</plugins>
147166
</pluginManagement>
148167
<plugins>
168+
<plugin>
169+
<groupId>io.quarkus</groupId>
170+
<artifactId>quarkus-maven-plugin</artifactId>
171+
<executions>
172+
<execution>
173+
<goals>
174+
<goal>build</goal>
175+
</goals>
176+
</execution>
177+
</executions>
178+
</plugin>
179+
<plugin>
180+
<artifactId>maven-surefire-plugin</artifactId>
181+
<version>${surefire-plugin.version}</version>
182+
<configuration>
183+
<systemPropertyVariables>
184+
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
185+
<maven.home>${maven.home}</maven.home>
186+
</systemPropertyVariables>
187+
</configuration>
188+
</plugin>
189+
<plugin>
190+
<artifactId>maven-failsafe-plugin</artifactId>
191+
<version>${surefire-plugin.version}</version>
192+
<executions>
193+
<execution>
194+
<goals>
195+
<goal>integration-test</goal>
196+
<goal>verify</goal>
197+
</goals>
198+
</execution>
199+
</executions>
200+
<configuration>
201+
<systemPropertyVariables>
202+
<native.image.path>${project.build.directory}/${project.build.finalName}-runner
203+
</native.image.path>
204+
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
205+
<maven.home>${maven.home}</maven.home>
206+
</systemPropertyVariables>
207+
</configuration>
208+
</plugin>
149209
<plugin>
150210
<groupId>org.apache.maven.plugins</groupId>
151211
<artifactId>maven-compiler-plugin</artifactId>
@@ -178,7 +238,8 @@
178238
</goals>
179239
<configuration>
180240
<!--suppress UnresolvedMavenProperty -->
181-
<configFile>${resourceglueoperator.project.root}/contributing/eclipse-google-style.xml</configFile>
241+
<configFile>${resourceglueoperator.project.root}/contributing/eclipse-google-style.xml
242+
</configFile>
182243
</configuration>
183244
</execution>
184245
</executions>
-21
Original file line numberDiff line numberDiff line change
@@ -1,21 +0,0 @@
1-
package io.csviri.operator.resourceglue;
2-
3-
import org.slf4j.Logger;
4-
import org.slf4j.LoggerFactory;
5-
6-
import io.csviri.operator.resourceglue.reconciler.glue.GlueReconciler;
7-
import io.csviri.operator.resourceglue.reconciler.operator.GlueOperatorReconciler;
8-
import io.javaoperatorsdk.operator.Operator;
9-
10-
public class Runner {
11-
12-
private static final Logger log = LoggerFactory.getLogger(Runner.class);
13-
14-
public static void main(String[] args) {
15-
Operator operator = new Operator();
16-
operator.register(new GlueReconciler());
17-
operator.register(new GlueOperatorReconciler());
18-
operator.start();
19-
log.info("resource-glue controller started.");
20-
}
21-
}

Diff for: src/main/java/io/csviri/operator/resourceglue/conditions/JavaScripCondition.java

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.time.LocalDateTime;
44
import java.time.temporal.ChronoUnit;
5+
import java.util.List;
56
import java.util.Map;
67
import java.util.stream.Collectors;
78

@@ -36,6 +37,11 @@ public boolean isMet(DependentResource<GenericKubernetesResource, Glue> dependen
3637
Glue glue,
3738
Context<Glue> context) {
3839
try {
40+
List<ScriptEngineFactory> engines = new ScriptEngineManager().getEngineFactories();
41+
for (ScriptEngineFactory f : engines) {
42+
System.out.println(f.getLanguageName() + " " + f.getEngineName() + " " + f.getNames());
43+
}
44+
3945
var start = LocalDateTime.now();
4046
ScriptEngineManager manager = new ScriptEngineManager();
4147
ScriptEngine engine = manager.getEngineByName("js");

Diff for: src/main/resources/log4j2.xml

-16
This file was deleted.

0 commit comments

Comments
 (0)