This repository was archived by the owner on Apr 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
feat: support for quarkus using CDI #91
Open
csviri
wants to merge
8
commits into
main
Choose a base branch
from
quarkus-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
17891f7
feat: support for quarkus using CDI
csviri be6406d
wip
csviri 8df96b6
Merge branch 'main' into quarkus-support
csviri 242d988
docs
csviri 9b2f6be
doc improvements
csviri 009ff85
Update README.md
csviri 4b64c9e
Update README.md
csviri b95f251
Merge branch 'main' into quarkus-support
csviri 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
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,128 @@ | ||
<?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"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>io.javaoperatorsdk</groupId> | ||
<artifactId>jenvtest-project</artifactId> | ||
<version>0.9.1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>jenvtest-quarkus-support</artifactId> | ||
<packaging>jar</packaging> | ||
<name>JEnvTest Quarkus Support</name> | ||
|
||
<properties> | ||
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id> | ||
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id> | ||
<quarkus.platform.version>2.16.6.Final</quarkus.platform.version> | ||
<surefire-plugin.version>3.0.0-M7</surefire-plugin.version> | ||
<compiler-plugin.version>3.10.1</compiler-plugin.version> | ||
<slf4j.version>1.7.36</slf4j.version> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>${quarkus.platform.group-id}</groupId> | ||
<artifactId>${quarkus.platform.artifact-id}</artifactId> | ||
<version>${quarkus.platform.version}</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.fabric8</groupId> | ||
<artifactId>kubernetes-client</artifactId> | ||
<scope>compile</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-arc</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-kubernetes-client</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jboss.logmanager</groupId> | ||
<artifactId>log4j2-jboss-logmanager</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.javaoperatorsdk</groupId> | ||
<artifactId>jenvtest</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.assertj</groupId> | ||
<artifactId>assertj-core</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.smallrye</groupId> | ||
<artifactId>jandex-maven-plugin</artifactId> | ||
<version>3.0.5</version> | ||
<executions> | ||
<execution> | ||
<id>make-index</id> | ||
<goals> | ||
<goal>jandex</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>${surefire-plugin.version}</version> | ||
<configuration> | ||
<systemPropertyVariables> | ||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> | ||
<maven.home>${maven.home}</maven.home> | ||
</systemPropertyVariables> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>${quarkus.platform.group-id}</groupId> | ||
<artifactId>quarkus-maven-plugin</artifactId> | ||
<version>${quarkus.platform.version}</version> | ||
<extensions>true</extensions> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>build</goal> | ||
<goal>generate-code</goal> | ||
<goal>generate-code-tests</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>${compiler-plugin.version}</version> | ||
<configuration> | ||
<compilerArgs> | ||
<arg>-parameters</arg> | ||
</compilerArgs> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
49 changes: 49 additions & 0 deletions
49
quarkus/src/main/java/io/javaoperatorsdk/jenvtest/quarkus/QuarkusTestConfiguration.java
This file contains hidden or 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,49 @@ | ||
package io.javaoperatorsdk.jenvtest.quarkus; | ||
|
||
import javax.enterprise.inject.Disposes; | ||
import javax.enterprise.inject.Produces; | ||
import javax.inject.Singleton; | ||
|
||
import io.fabric8.kubernetes.client.Config; | ||
import io.fabric8.kubernetes.client.KubernetesClient; | ||
import io.fabric8.kubernetes.client.KubernetesClientBuilder; | ||
import io.javaoperatorsdk.jenvtest.KubeAPIServer; | ||
import io.javaoperatorsdk.jenvtest.KubeAPIServerConfig; | ||
import io.javaoperatorsdk.jenvtest.KubeAPIServerConfigBuilder; | ||
import io.quarkus.arc.DefaultBean; | ||
|
||
public class QuarkusTestConfiguration { | ||
|
||
@Produces | ||
@Singleton | ||
public KubeAPIServer kubeAPIServer(KubeAPIServerConfig config) { | ||
KubeAPIServer kubeAPIServer = new KubeAPIServer(config); | ||
kubeAPIServer.start(); | ||
|
||
return kubeAPIServer; | ||
} | ||
|
||
@Produces | ||
@Singleton | ||
@DefaultBean | ||
public KubeAPIServerConfig kubeAPIServerConfig() { | ||
return new KubeAPIServerConfigBuilder().build(); | ||
} | ||
|
||
public void stopKubeAPIServer(@Disposes KubeAPIServer kubeAPIServer) { | ||
kubeAPIServer.stop(); | ||
} | ||
|
||
@Produces | ||
@Singleton | ||
public KubernetesClient kubeApiServerClient(KubeAPIServer kubeAPIServer) { | ||
return new KubernetesClientBuilder() | ||
.withConfig(Config.fromKubeconfig(kubeAPIServer.getKubeConfigYaml())) | ||
.build(); | ||
} | ||
|
||
public void closeClient(@Disposes KubernetesClient kubernetesClient) { | ||
kubernetesClient.close(); | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
quarkus/src/test/java/io/javaoperatorsdk/jenvtest/quarkus/QuarkusSupportTest.java
This file contains hidden or 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,22 @@ | ||
package io.javaoperatorsdk.jenvtest.quarkus; | ||
|
||
import javax.inject.Inject; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import io.fabric8.kubernetes.client.KubernetesClient; | ||
import io.quarkus.test.junit.QuarkusTest; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@QuarkusTest | ||
class QuarkusSupportTest { | ||
|
||
@Inject | ||
KubernetesClient client; | ||
|
||
@Test | ||
void setsUpJenvtestServerAndClient() { | ||
assertThat(client.getKubernetesVersion().getGitVersion()).startsWith("v1.26"); | ||
} | ||
} |
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.
We should probably target Quarkus 3 (which is already tagged).
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.
AFAIK there is no officeial release yet: https://github.com/quarkusio/quarkus/releases
neother on the website, also the automatic update script updates it into CR2
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.
Final is already tagged so this is what should be used moving forward, imo.