-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24162 from Sgitario/additional_jvm_args
feat: container images to provide a new property to append jvm args
- Loading branch information
Showing
15 changed files
with
191 additions
and
15 deletions.
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
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
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
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
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
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
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
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
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
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
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
61 changes: 61 additions & 0 deletions
61
...d-way/src/test/java/io/quarkus/it/kubernetes/OpenshiftWithJvmAdditionalArgumentsTest.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,61 @@ | ||
package io.quarkus.it.kubernetes; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Path; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.fabric8.kubernetes.api.model.HasMetadata; | ||
import io.fabric8.openshift.api.model.DeploymentConfig; | ||
import io.quarkus.bootstrap.model.AppArtifact; | ||
import io.quarkus.builder.Version; | ||
import io.quarkus.test.ProdBuildResults; | ||
import io.quarkus.test.ProdModeTestResults; | ||
import io.quarkus.test.QuarkusProdModeTest; | ||
|
||
public class OpenshiftWithJvmAdditionalArgumentsTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusProdModeTest config = new QuarkusProdModeTest() | ||
.withApplicationRoot((jar) -> jar.addClasses(GreetingResource.class)) | ||
.setApplicationName("openshift-with-jvm-additional-arguments") | ||
.setApplicationVersion("0.1-SNAPSHOT") | ||
.withConfigurationResource("openshift-with-jvm-additional-arguments.properties") | ||
.setForcedDependencies(Collections.singletonList( | ||
new AppArtifact("io.quarkus", "quarkus-openshift", Version.getVersion())));; | ||
|
||
@ProdBuildResults | ||
private ProdModeTestResults prodModeTestResults; | ||
|
||
@Test | ||
public void assertGeneratedResources() throws IOException { | ||
Path kubernetesDir = prodModeTestResults.getBuildDir().resolve("kubernetes"); | ||
List<HasMetadata> openshiftList = DeserializationUtil | ||
.deserializeAsList(kubernetesDir.resolve("openshift.yml")); | ||
|
||
assertThat(openshiftList.get(1)).isInstanceOfSatisfying(DeploymentConfig.class, dc -> { | ||
assertThat(dc.getMetadata()).satisfies(m -> { | ||
assertThat(m.getName()).isEqualTo("openshift-with-jvm-additional-arguments"); | ||
}); | ||
assertThat(dc.getSpec()).satisfies(deploymentSpec -> { | ||
assertThat(deploymentSpec.getTemplate()).satisfies(t -> { | ||
assertThat(t.getSpec()).satisfies(podSpec -> { | ||
assertThat(podSpec.getContainers()).singleElement().satisfies(container -> { | ||
assertThat(container.getCommand()).containsExactly("java", | ||
"-Dquarkus.http.host=0.0.0.0", | ||
"-Djava.util.logging.manager=org.jboss.logmanager.LogManager", | ||
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", | ||
"-jar", | ||
"/deployments/quarkus-run.jar"); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
...us-standard-way/src/test/java/io/quarkus/it/kubernetes/OpenshiftWithJvmArgumentsTest.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,59 @@ | ||
package io.quarkus.it.kubernetes; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Path; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.fabric8.kubernetes.api.model.HasMetadata; | ||
import io.fabric8.openshift.api.model.DeploymentConfig; | ||
import io.quarkus.bootstrap.model.AppArtifact; | ||
import io.quarkus.builder.Version; | ||
import io.quarkus.test.ProdBuildResults; | ||
import io.quarkus.test.ProdModeTestResults; | ||
import io.quarkus.test.QuarkusProdModeTest; | ||
|
||
public class OpenshiftWithJvmArgumentsTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusProdModeTest config = new QuarkusProdModeTest() | ||
.withApplicationRoot((jar) -> jar.addClasses(GreetingResource.class)) | ||
.setApplicationName("openshift-with-jvm-arguments") | ||
.setApplicationVersion("0.1-SNAPSHOT") | ||
.withConfigurationResource("openshift-with-jvm-arguments.properties") | ||
.setForcedDependencies(Collections.singletonList( | ||
new AppArtifact("io.quarkus", "quarkus-openshift", Version.getVersion())));; | ||
|
||
@ProdBuildResults | ||
private ProdModeTestResults prodModeTestResults; | ||
|
||
@Test | ||
public void assertGeneratedResources() throws IOException { | ||
Path kubernetesDir = prodModeTestResults.getBuildDir().resolve("kubernetes"); | ||
List<HasMetadata> openshiftList = DeserializationUtil | ||
.deserializeAsList(kubernetesDir.resolve("openshift.yml")); | ||
|
||
assertThat(openshiftList.get(1)).isInstanceOfSatisfying(DeploymentConfig.class, dc -> { | ||
assertThat(dc.getMetadata()).satisfies(m -> { | ||
assertThat(m.getName()).isEqualTo("openshift-with-jvm-arguments"); | ||
}); | ||
assertThat(dc.getSpec()).satisfies(deploymentSpec -> { | ||
assertThat(deploymentSpec.getTemplate()).satisfies(t -> { | ||
assertThat(t.getSpec()).satisfies(podSpec -> { | ||
assertThat(podSpec.getContainers()).singleElement().satisfies(container -> { | ||
assertThat(container.getCommand()).containsExactly("java", | ||
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", | ||
"-jar", | ||
"/deployments/quarkus-run.jar"); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
...uarkus-standard-way/src/test/resources/openshift-with-jvm-additional-arguments.properties
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,2 @@ | ||
quarkus.kubernetes.deployment-target=openshift | ||
quarkus.openshift.jvm-additional-arguments=-agentlib:jdwp=transport=dt_socket\\,server=y\\,suspend=n\\,address=*:5005 |
2 changes: 2 additions & 0 deletions
2
...ubernetes/quarkus-standard-way/src/test/resources/openshift-with-jvm-arguments.properties
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,2 @@ | ||
quarkus.kubernetes.deployment-target=openshift | ||
quarkus.openshift.jvm-arguments=-agentlib:jdwp=transport=dt_socket\\,server=y\\,suspend=n\\,address=*:5005 |