From 9967e0833b6a544ae5d2ed58464703c345929a93 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Wed, 2 Aug 2023 11:42:28 +0200 Subject: [PATCH 1/2] Properly use internal links to point to other guides Otherwise, our users won't have a consistent experience when browsing the maintenance version documentation. --- .../main/asciidoc/azure-functions-http.adoc | 2 +- docs/src/main/asciidoc/azure-functions.adoc | 2 +- .../asciidoc/building-my-first-extension.adoc | 2 +- docs/src/main/asciidoc/cassandra.adoc | 7 +++---- docs/src/main/asciidoc/cli-tooling.adoc | 2 +- docs/src/main/asciidoc/datasource.adoc | 2 +- .../main/asciidoc/deploying-to-kubernetes.adoc | 4 ++-- .../main/asciidoc/deploying-to-openshift.adoc | 8 ++++---- .../main/asciidoc/extension-registry-user.adoc | 4 ++-- docs/src/main/asciidoc/kafka.adoc | 4 ++-- docs/src/main/asciidoc/maven-tooling.adoc | 2 +- ...security-basic-authentication-tutorial.adoc | 2 +- docs/src/main/asciidoc/security-jpa.adoc | 2 +- docs/src/main/asciidoc/stork-kubernetes.adoc | 4 ++-- docs/src/main/asciidoc/update-quarkus.adoc | 2 +- docs/src/main/asciidoc/vertx-reference.adoc | 18 +++++++++--------- 16 files changed, 33 insertions(+), 34 deletions(-) diff --git a/docs/src/main/asciidoc/azure-functions-http.adoc b/docs/src/main/asciidoc/azure-functions-http.adoc index 4496bd3014380..4316d91605134 100644 --- a/docs/src/main/asciidoc/azure-functions-http.adoc +++ b/docs/src/main/asciidoc/azure-functions-http.adoc @@ -160,7 +160,7 @@ The `quarkus-azure-functions-http` extension handles all the work to deploy to A Quarkus will use the Azure CLI in the background to authenticate and deploy to Azure. If you have multiple subscriptions associated with your account, you must set the `quarkus.azure-functions.subscription-id` property in your `application.properties` file to the subscription you want to use. -For other authentication mechanisms and deployment options see our config properties https://quarkus.io/guides/all-config[here]. +For other authentication mechanisms and deployment options see our config properties xref:all-config.adoc[here]. To run the deploy, after you build your project execute: diff --git a/docs/src/main/asciidoc/azure-functions.adoc b/docs/src/main/asciidoc/azure-functions.adoc index df4d9a81a7523..c58f6ece1dc8e 100644 --- a/docs/src/main/asciidoc/azure-functions.adoc +++ b/docs/src/main/asciidoc/azure-functions.adoc @@ -177,7 +177,7 @@ The `quarkus-azure-functions` extension handles all the work to deploy to Azure. Quarkus will use the Azure CLI in the background to authenticate and deploy to Azure. If you have multiple subscriptions associated with your account, you must set the `quarkus.azure-functions.subscription-id` property in your `application.properties` file to the subscription you want to use. -For other authentication mechanisms and deployment options see our config properties https://quarkus.io/guides/all-config[here]. +For other authentication mechanisms and deployment options see our config properties xref:all-config.adoc[here]. To run the deploy, after you build your project execute: diff --git a/docs/src/main/asciidoc/building-my-first-extension.adoc b/docs/src/main/asciidoc/building-my-first-extension.adoc index e64d7803ac132..3cc1d82011258 100644 --- a/docs/src/main/asciidoc/building-my-first-extension.adoc +++ b/docs/src/main/asciidoc/building-my-first-extension.adoc @@ -903,7 +903,7 @@ From an application developer perspective, a Quarkus platform is represented as link:https://github.com/quarkiverse[Quarkiverse Hub] is the GitHub organization that provides repository hosting (including build, CI and release publishing setup) for Quarkus extension projects contributed by the community. -In case you are wondering about creating a new Quarkus extension and adding it to the Quarkus ecosystem so that the Quarkus community can discover it using the Quarkus dev tools (including the https://quarkus.io/guides/cli-tooling[Quarkus CLI] and https://code.quarkus.io[code.quarkus.io]), the https://github.com/quarkiverse[Quarkiverse Hub] GitHub organization will be a good home for it. +In case you are wondering about creating a new Quarkus extension and adding it to the Quarkus ecosystem so that the Quarkus community can discover it using the Quarkus dev tools (including the xref:cli-tooling.adoc[Quarkus CLI] and https://code.quarkus.io[code.quarkus.io]), the https://github.com/quarkiverse[Quarkiverse Hub] GitHub organization will be a good home for it. You can get started by creating an link:https://github.com/quarkusio/quarkus/issues/new/choose[Extension Request] issue (check first if one wasn't already submitted link:https://github.com/quarkusio/quarkus/labels/kind%2Fextension-proposal[here]) and asking to lead it. diff --git a/docs/src/main/asciidoc/cassandra.adoc b/docs/src/main/asciidoc/cassandra.adoc index b6ebb0c1790e5..e68ada8b38153 100644 --- a/docs/src/main/asciidoc/cassandra.adoc +++ b/docs/src/main/asciidoc/cassandra.adoc @@ -789,8 +789,7 @@ until your application actually connects and hits the database for the first tim == Running in native mode -If you installed GraalVM, you can link:https://quarkus.io/guides/building-native-image[build a -native image] using: +If you installed GraalVM, you can xref:building-native-image.adoc[build a native image] using: [source,shell] ---- @@ -830,8 +829,8 @@ that needs to interact with the Cassandra database. Using lazy initialization speeds up your application startup time, and avoids startup failures if the Cassandra database is not available. However, it could also prove dangerous if your code is -fully non-blocking, for example if it uses https://quarkus.io/guides/reactive-routes[reactive -routes]. Indeed, the lazy initialization could accidentally happen on a thread that is not allowed +fully non-blocking, for example if it uses xref:reactive-routes.adoc[reactive routes]. +Indeed, the lazy initialization could accidentally happen on a thread that is not allowed to block, such as a Vert.x event loop thread. Therefore, setting `quarkus.cassandra.init.eager-init` to `false` and injecting `QuarkusCqlSession` should be avoided in these contexts. diff --git a/docs/src/main/asciidoc/cli-tooling.adoc b/docs/src/main/asciidoc/cli-tooling.adoc index aac26a5b05418..fa811bdf19c64 100644 --- a/docs/src/main/asciidoc/cli-tooling.adoc +++ b/docs/src/main/asciidoc/cli-tooling.adoc @@ -398,7 +398,7 @@ Both `quarkus create` and `quarkus extension list` allow you to explicitly speci 1. Specify a specific Platform Release BOM + -A https://quarkus.io/guides/platform#quarkus-platform-bom[Quarkus Platform release BOM] is identified by `groupId:artifactId:version` (GAV) coordinates. When specifying a platform release BOM, you may use empty segments to fall back to default values (shown with `quarkus create app --help`). If you specify only one segment (no `:`), it is assumed to be a version. +A xref:platform.adoc#quarkus-platform-bom[Quarkus Platform release BOM] is identified by `groupId:artifactId:version` (GAV) coordinates. When specifying a platform release BOM, you may use empty segments to fall back to default values (shown with `quarkus create app --help`). If you specify only one segment (no `:`), it is assumed to be a version. + `{quarkus-platform-groupid}` is the default `groupId`. Specifying `-P :quarkus-bom:` is equivalent to `-P {quarkus-platform-groupid}:quarkus-bom:{quarkus-version}`. Note that you need to specify the `groupId` to work with a snapshot, e.g. `-P io.quarkus::999-SNAPSHOT` is equivalent to `-P io.quarkus:quarkus-bom:999-SNAPSHOT`. + diff --git a/docs/src/main/asciidoc/datasource.adoc b/docs/src/main/asciidoc/datasource.adoc index 8c8f8f6887217..d5afd66cfb894 100644 --- a/docs/src/main/asciidoc/datasource.adoc +++ b/docs/src/main/asciidoc/datasource.adoc @@ -407,7 +407,7 @@ To exclude only a particular datasource from the health check, use: === Datasource metrics -If you are using the link:https://quarkus.io/guides/micrometer[`quarkus-micrometer`] or link:https://quarkus.io/guides/smallrye-metrics[`quarkus-smallrye-metrics`] extension, `quarkus-agroal` can contribute some datasource-related metrics to the metric registry. +If you are using the xref:micrometer.adoc[`quarkus-micrometer`] or xref:smallrye-metrics.adoc[`quarkus-smallrye-metrics`] extension, `quarkus-agroal` can contribute some datasource-related metrics to the metric registry. This can be activated by setting the `quarkus.datasource.metrics.enabled` property to `true`. For the exposed metrics to contain any actual values, a metric collection must be enabled internally by the Agroal mechanisms. diff --git a/docs/src/main/asciidoc/deploying-to-kubernetes.adoc b/docs/src/main/asciidoc/deploying-to-kubernetes.adoc index 5895c885045e0..1e03c9dcd7b68 100644 --- a/docs/src/main/asciidoc/deploying-to-kubernetes.adoc +++ b/docs/src/main/asciidoc/deploying-to-kubernetes.adoc @@ -236,7 +236,7 @@ You can provide the arguments that will be used by the Kubernetes Job via the pr Finally, the Kubernetes job will be launched every time it is installed in Kubernetes. You can know more about how to run Kubernetes jobs in this https://kubernetes.io/docs/concepts/workloads/controllers/job/#running-an-example-job[link]. -You can configure the rest of the Kubernetes Job configuration using the properties under `quarkus.kubernetes.job.xxx` (see https://quarkus.io/guides/deploying-to-kubernetes#quarkus-kubernetes-kubernetes-config_quarkus.kubernetes.job.parallelism-parallelism[link]). +You can configure the rest of the Kubernetes Job configuration using the properties under `quarkus.kubernetes.job.xxx` (see xref:deploying-to-kubernetes.adoc#quarkus-kubernetes-kubernetes-config_quarkus.kubernetes.job.parallelism[link]). ==== Generating CronJob resources @@ -251,7 +251,7 @@ quarkus.kubernetes.cron-job.schedule=0 * * * * IMPORTANT: CronJob resources require the https://en.wikipedia.org/wiki/Cron[Cron] expression to specify when to launch the job via the property `quarkus.kubernetes.cron-job.schedule`. If not provide, the build will fail. -You can configure the rest of the Kubernetes CronJob configuration using the properties under `quarkus.kubernetes.cron-job.xxx` (see https://quarkus.io/guides/deploying-to-kubernetes#quarkus-kubernetes-kubernetes-config_quarkus.kubernetes.cron-job.parallelism-parallelism[link]). +You can configure the rest of the Kubernetes CronJob configuration using the properties under `quarkus.kubernetes.cron-job.xxx` (see xref:deploying-to-kubernetes.adoc#quarkus-kubernetes-kubernetes-config_quarkus.kubernetes.cron-job.parallelism[link]). === Namespace diff --git a/docs/src/main/asciidoc/deploying-to-openshift.adoc b/docs/src/main/asciidoc/deploying-to-openshift.adoc index cd15c8fddf5d6..1ff4619a3b958 100644 --- a/docs/src/main/asciidoc/deploying-to-openshift.adoc +++ b/docs/src/main/asciidoc/deploying-to-openshift.adoc @@ -91,7 +91,7 @@ include::{includes}/devtools/build.adoc[] TIP: If you want to test your application immediately then set the `quarkus.openshift.route.expose` config property to `true` to <>, e.g. add `-Dquarkus.openshift.route.expose=true` to the command above. [#re-deploy-with-service-binding] -NOTE: When using `DeploymentConfig` and https://quarkus.io/guides/deploying-to-kubernetes#service_binding[Service Binding], re-deploying might remove the configuration added by OpenShift to allow service discovery. A new container image build will trigger a refresh of the Quarkus app in OpenShift: `-Dquarkus.container-image.build=true` which might be enough in most situations. If you need to update the OpenShift resources, you need to delete the binding first to create it again after new deployment. +NOTE: When using `DeploymentConfig` and xref:deploying-to-kubernetes.adoc#service_binding[Service Binding], re-deploying might remove the configuration added by OpenShift to allow service discovery. A new container image build will trigger a refresh of the Quarkus app in OpenShift: `-Dquarkus.container-image.build=true` which might be enough in most situations. If you need to update the OpenShift resources, you need to delete the binding first to create it again after new deployment. This command will build your application locally, then trigger a container image build and finally apply the generated OpenShift resources automatically. The generated resources use OpenShift's `DeploymentConfig` that is configured to automatically trigger a redeployment when a change in the `ImageStream` is noticed. @@ -147,7 +147,7 @@ During the build you may find the `Caused by: javax.net.ssl.SSLHandshakeExceptio quarkus.kubernetes-client.trust-certs=true ---- -For more information, see link:https://quarkus.io/guides/deploying-to-kubernetes#client-connection-configuration[deploying to Kubernetes]. +For more information, see xref:deploying-to-kubernetes.adoc#client-connection-configuration[deploying to Kubernetes]. ==== Once the build is done we can create a new application from the relevant `ImageStream`. @@ -415,7 +415,7 @@ You can provide the arguments that will be used by the Kubernetes Job via the pr Finally, the Kubernetes job will be launched every time that is installed in OpenShift. You can know more about how to run Kubernetes jobs in this https://kubernetes.io/docs/concepts/workloads/controllers/job/#running-an-example-job[link]. -You can configure the rest of the Kubernetes Job configuration using the properties under `quarkus.openshift.job.xxx` (see https://quarkus.io/guides/deploying-to-openshift#quarkus-openshift-openshift-config_quarkus.openshift.job.parallelism[link]). +You can configure the rest of the Kubernetes Job configuration using the properties under `quarkus.openshift.job.xxx` (see xref:deploying-to-openshift#quarkus-openshift-openshift-config_quarkus.openshift.job.parallelism[link]). ===== Generating CronJob resources @@ -430,7 +430,7 @@ quarkus.openshift.cron-job.schedule=0 * * * * IMPORTANT: CronJob resources require the https://en.wikipedia.org/wiki/Cron[Cron] expression to specify when to launch the job via the property `quarkus.openshift.cron-job.schedule`. If not provide, the build will fail. -You can configure the rest of the Kubernetes CronJob configuration using the properties under `quarkus.openshift.cron-job.xxx` (see https://quarkus.io/guides/deploying-to-openshift#quarkus-openshift-openshift-config_quarkus.openshift.cron-job.parallelism[link]). +You can configure the rest of the Kubernetes CronJob configuration using the properties under `quarkus.openshift.cron-job.xxx` (see xref:deploying-to-openshift.adoc#quarkus-openshift-openshift-config_quarkus.openshift.cron-job.parallelism[link]). ==== Validation diff --git a/docs/src/main/asciidoc/extension-registry-user.adoc b/docs/src/main/asciidoc/extension-registry-user.adoc index 6768fa06b2218..2a2d88c2f5783 100644 --- a/docs/src/main/asciidoc/extension-registry-user.adoc +++ b/docs/src/main/asciidoc/extension-registry-user.adoc @@ -8,7 +8,7 @@ include::_attributes.adoc[] :categories: architecture :summary: Learn more about the notion of extension registry and how you can use your own. -The Quarkus dev tools, such as the https://quarkus.io/guides/cli-tooling[Quarkus CLI], the https://quarkus.io/guides/maven-tooling[Maven] and the https://quarkus.io/guides/gradle-tooling[Gradle] plugins, or https://code.quarkus.io[code.quarkus.io] can be used to list and search the Quarkus ecosystem for extensions that match a certain criteria. That includes the https://quarkus.io/guides/platform[Quarkus platform] extensions and various other extensions contributed by the community, many of which are hosted on the https://github.com/quarkiverse[Quarkiverse Hub]. +The Quarkus dev tools, such as the xref:cli-tooling.adoc[Quarkus CLI], the xref:maven-tooling.adoc[Maven] and the xref:gradle-tooling.adoc[Gradle] plugins, or https://code.quarkus.io[code.quarkus.io] can be used to list and search the Quarkus ecosystem for extensions that match a certain criteria. That includes the xref:platform.adoc[Quarkus platform] extensions and various other extensions contributed by the community, many of which are hosted on the https://github.com/quarkiverse[Quarkiverse Hub]. The information about all the available Quarkus extensions is provided to the dev tools by __Quarkus extension registries__. @@ -76,7 +76,7 @@ When the Quarkus dev tools are launched, a search for the registry client config === Configuring multiple registries -The <> is the default Quarkus community extension registry, but it is not meant to be always the only registry. Other organizations may find it useful to create their own Quarkus extension registries to provide their own https://quarkus.io/guides/platform[Quarkus platforms] and/or individual (non-platform) Quarkus extensions. Users wishing to enable custom Quarkus extension registries in their environment would need to add them to the registry client configuration file. +The <> is the default Quarkus community extension registry, but it is not meant to be always the only registry. Other organizations may find it useful to create their own Quarkus extension registries to provide their own xref:platform.adoc[Quarkus platforms] and/or individual (non-platform) Quarkus extensions. Users wishing to enable custom Quarkus extension registries in their environment would need to add them to the registry client configuration file. The registry client configuration file is a simple YAML file which contains a list of registries, for example: diff --git a/docs/src/main/asciidoc/kafka.adoc b/docs/src/main/asciidoc/kafka.adoc index 2403dd67d5828..4e8572bcda44a 100644 --- a/docs/src/main/asciidoc/kafka.adoc +++ b/docs/src/main/asciidoc/kafka.adoc @@ -788,7 +788,7 @@ Quarkus provides following state store implementations: - `quarkus-redis`: Uses the xref:redis-reference.adoc[`quarkus-redis-client`] extension to persist processing states. Jackson is used to serialize processing state in Json. For complex objects it is required to configure the `checkpoint.state-type` property with the class name of the object. -By default, the state store uses the default redis client, but if a link:https://quarkus.io/guides/redis-reference#default-and-named-clients[named client] is to be used, the client name can be specified using the `mp.messaging.incoming.[channel-name].checkpoint.quarkus-redis.client-name` property. +By default, the state store uses the default redis client, but if a xref:redis-reference.adoc#default-and-named-clients[named client] is to be used, the client name can be specified using the `mp.messaging.incoming.[channel-name].checkpoint.quarkus-redis.client-name` property. Processing states will be stored in Redis using the key naming scheme `[consumer-group-id]:[topic]:[partition]`. For example the configuration of the previous code would be the following: @@ -1300,7 +1300,7 @@ While a transaction is in progress, subsequent calls to the `withTransaction`, i Note that in Reactive Messaging, the execution of processing methods, is already serialized, unless `@Blocking(ordered = false)` is used. If `withTransaction` can be called concurrently, for example from a REST endpoint, it is recommended to limit the concurrency of the execution. -This can be done using the `@Bulkhead` annotation from link:https://quarkus.io/guides/smallrye-fault-tolerance[_Microprofile Fault Tolerance_]. +This can be done using the `@Bulkhead` annotation from xref:smallrye-fault-tolerance.adoc[_Microprofile Fault Tolerance_]. An example usage can be found in <>. ==== diff --git a/docs/src/main/asciidoc/maven-tooling.adoc b/docs/src/main/asciidoc/maven-tooling.adoc index 0bf7c0bb34b2e..cc758093937ed 100644 --- a/docs/src/main/asciidoc/maven-tooling.adoc +++ b/docs/src/main/asciidoc/maven-tooling.adoc @@ -59,7 +59,7 @@ If you are using the Maven command, the following table lists the attributes you | The artifact id of the target platform BOM. | `platformVersion` -| The version currently recommended by the https://quarkus.io/guides/extension-registry-user[Quarkus Extension Registry] +| The version currently recommended by the xref:extension-registry-user.adoc[Quarkus Extension Registry] | The version of the platform you want the project to use. It can also accept a version range, in which case the latest from the specified range will be used. | `javaVersion` diff --git a/docs/src/main/asciidoc/security-basic-authentication-tutorial.adoc b/docs/src/main/asciidoc/security-basic-authentication-tutorial.adoc index 91ce6c237fc59..06e11d4620c6b 100644 --- a/docs/src/main/asciidoc/security-basic-authentication-tutorial.adoc +++ b/docs/src/main/asciidoc/security-basic-authentication-tutorial.adoc @@ -334,7 +334,7 @@ As a result, the `security-jpa` defaults to using bcrypt-hashed passwords. == Test your application by using Dev Services for PostgreSQL -Complete the integration testing of your application in JVM and native modes by using xref:https://quarkus.io/guides/dev-services#databases[Dev Services for PostgreSQL] before you run your application in production mode. +Complete the integration testing of your application in JVM and native modes by using xref:dev-services.adoc#databases[Dev Services for PostgreSQL] before you run your application in production mode. To run your application in dev mode: diff --git a/docs/src/main/asciidoc/security-jpa.adoc b/docs/src/main/asciidoc/security-jpa.adoc index 68751f990c4fe..25f4d7195869c 100644 --- a/docs/src/main/asciidoc/security-jpa.adoc +++ b/docs/src/main/asciidoc/security-jpa.adoc @@ -17,7 +17,7 @@ Quarkus security offers a Jakarta Persistence integration to collect usernames, The following Jakarta Persistence entity specification demonstrates how users' information needs to be stored in a Jakarta Persistence entity and properly mapped so that Quarkus can retrieve this information from a database. -* The `@UserDefinition` annotation must be present on a Jakarta Persistence entity, regardless of whether link:https://quarkus.io/guides/hibernate-orm-panache[simplified Hibernate ORM with Panache] is used or not. +* The `@UserDefinition` annotation must be present on a Jakarta Persistence entity, regardless of whether xref:hibernate-orm-panache.adoc[simplified Hibernate ORM with Panache] is used or not. * The `@Username` and `@Password` field types are always `String`. diff --git a/docs/src/main/asciidoc/stork-kubernetes.adoc b/docs/src/main/asciidoc/stork-kubernetes.adoc index e07d379cbafa2..dce9a2509f978 100644 --- a/docs/src/main/asciidoc/stork-kubernetes.adoc +++ b/docs/src/main/asciidoc/stork-kubernetes.adoc @@ -108,7 +108,7 @@ implementation("io.quarkus:quarkus-container-image-jib") Let's start with the very beginning: the service we will discover, select and call. -The Red and Blue are two simple REST services serving an endpoint responding `Hello from Red!` and `Hello from Blue!` respectively. The code of both applications has been developed following the https://quarkus.io/guides/getting-started[Getting Started Guide]. +The Red and Blue are two simple REST services serving an endpoint responding `Hello from Red!` and `Hello from Blue!` respectively. The code of both applications has been developed following the xref:getting-started.adoc[Getting Started Guide]. As the goal of this guide is to show how to use Stork Kubernetes service discovery, we won't provide the specifics steps for the Red and Blue services. Their container images are already built and available in a public registry: @@ -409,7 +409,7 @@ The `quarkus.container-image.registry` contains the container registry to use. The `quarkus.kubernetes.ingress.expose` indicates that the service will be accessible from the outside of the cluster. The `quarkus.kubernetes.ingress.host` contains the url to access the service. We are using https://nip.io/[nip.io] wildcard for IP address mappings. -For a more customized configuration you can check the https://quarkus.io/guides/deploying-to-kubernetes[Deploying to Kubernetes guide] +For a more customized configuration you can check the xref:deploying-to-kubernetes.adoc[Deploying to Kubernetes guide] == Build and push the container image diff --git a/docs/src/main/asciidoc/update-quarkus.adoc b/docs/src/main/asciidoc/update-quarkus.adoc index b6f69f82fd3a4..3a09d03937e27 100644 --- a/docs/src/main/asciidoc/update-quarkus.adoc +++ b/docs/src/main/asciidoc/update-quarkus.adoc @@ -36,7 +36,7 @@ include::{includes}/prerequisites.adoc[] . Create a working branch for your project by using your version control system. -. To use the Quarkus CLI in the next step, link:https://quarkus.io/guides/cli-tooling#installing-the-cli[install the latest version of the Quarkus CLI]. +. To use the Quarkus CLI in the next step, xref:cli-tooling.adoc#installing-the-cli[install the latest version of the Quarkus CLI]. Confirm the version number using `quarkus -v`. . Go to the project directory and update the project to the latest stream: diff --git a/docs/src/main/asciidoc/vertx-reference.adoc b/docs/src/main/asciidoc/vertx-reference.adoc index f87565ce76105..6e0a63757ef36 100644 --- a/docs/src/main/asciidoc/vertx-reference.adoc +++ b/docs/src/main/asciidoc/vertx-reference.adoc @@ -82,7 +82,7 @@ Check the associated documentation to learn how to use them. |AMQP Client |`io.quarkus:quarkus-smallrye-reactive-messaging-amqp` (extension) -|https://quarkus.io/guides/amqp +|xref:amqp.adoc |Circuit Breaker |`io.smallrye.reactive:smallrye-mutiny-vertx-circuit-breaker` (external dependency) @@ -94,15 +94,15 @@ Check the associated documentation to learn how to use them. |DB2 Client |`io.quarkus:quarkus-reactive-db2-client` (extension) -|https://quarkus.io/guides/reactive-sql-clients +|xref:reactive-sql-clients.adoc |Kafka Client |`io.quarkus:quarkus-smallrye-reactive-messaging-kafka` (extension) -|https://quarkus.io/guides/kafka +|xref:kafka.adoc |Mail Client |`io.quarkus:quarkus-mailer` (extension) -|https://quarkus.io/guides/mailer +|xref:mailer.adoc |MQTT Client |`io.quarkus:quarkus-smallrye-reactive-messaging-mqtt` (extension) @@ -110,19 +110,19 @@ Check the associated documentation to learn how to use them. |MS SQL Client |`io.quarkus:quarkus-reactive-mssql-client` (extension) -|https://quarkus.io/guides/reactive-sql-clients +|xref:reactive-sql-clients.adoc |MySQL Client |`io.quarkus:quarkus-reactive-mysql-client` (extension) -|https://quarkus.io/guides/reactive-sql-clients +|xref:reactive-sql-clients.adoc |Oracle Client |`io.quarkus:quarkus-reactive-oracle-client` (extension) -|https://quarkus.io/guides/reactive-sql-clients +|xref:reactive-sql-clients.adoc |PostgreSQL Client |`io.quarkus:quarkus-reactive-pg-client` (extension) -|https://quarkus.io/guides/reactive-sql-clients +|xref:reactive-sql-clients.adoc |RabbitMQ Client |`io.smallrye.reactive:smallrye-mutiny-vertx-rabbitmq-client` (external dependency) @@ -130,7 +130,7 @@ Check the associated documentation to learn how to use them. |Redis Client |`io.quarkus:quarkus-redis-client` (extension) -|https://quarkus.io/guides/redis +|xref:redis.adoc |Web Client |`io.smallrye.reactive:smallrye-mutiny-vertx-web-client` (external dependency) From 9d3cc269c89d4262c8deec8386359e5403f48495 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Wed, 2 Aug 2023 14:14:19 +0200 Subject: [PATCH 2/2] Rename config classes for container image extensions to avoid conflicts --- ...nfig.java => ContainerImageJibConfig.java} | 4 +- .../image/jib/deployment/JibProcessor.java | 36 +++++++++-------- ...ava => ContainerImageOpenshiftConfig.java} | 4 +- .../deployment/OpenshiftProcessor.java | 40 +++++++++---------- .../openshift/deployment/OpenshiftUtils.java | 9 +++-- ...nfig.java => ContainerImageS2iConfig.java} | 4 +- .../image/s2i/deployment/S2iProcessor.java | 25 +++++++----- 7 files changed, 65 insertions(+), 57 deletions(-) rename extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/{JibConfig.java => ContainerImageJibConfig.java} (98%) rename extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/{OpenshiftConfig.java => ContainerImageOpenshiftConfig.java} (98%) rename extensions/container-image/container-image-s2i/deployment/src/main/java/io/quarkus/container/image/s2i/deployment/{S2iConfig.java => ContainerImageS2iConfig.java} (97%) diff --git a/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibConfig.java b/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/ContainerImageJibConfig.java similarity index 98% rename from extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibConfig.java rename to extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/ContainerImageJibConfig.java index 106207774b677..cc3f2c1060d6a 100644 --- a/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibConfig.java +++ b/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/ContainerImageJibConfig.java @@ -9,8 +9,8 @@ import io.quarkus.runtime.annotations.ConfigPhase; import io.quarkus.runtime.annotations.ConfigRoot; -@ConfigRoot(phase = ConfigPhase.BUILD_TIME) -public class JibConfig { +@ConfigRoot(name = "jib", phase = ConfigPhase.BUILD_TIME) +public class ContainerImageJibConfig { public static final String DEFAULT_WORKING_DIR = "/home/jboss"; /** diff --git a/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java b/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java index afa60bb08ea23..e406fed36f2ea 100644 --- a/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java +++ b/extensions/container-image/container-image-jib/deployment/src/main/java/io/quarkus/container/image/jib/deployment/JibProcessor.java @@ -116,7 +116,7 @@ public AvailableContainerImageExtensionBuildItem availability() { // in order to make the AppCDS usable by the runtime JVM @BuildStep(onlyIf = JibBuild.class) public void appCDS(ContainerImageConfig containerImageConfig, CompiledJavaVersionBuildItem compiledJavaVersion, - JibConfig jibConfig, + ContainerImageJibConfig jibConfig, BuildProducer producer) { if (!containerImageConfig.isBuildExplicitlyEnabled() && !containerImageConfig.isPushExplicitlyEnabled()) { @@ -126,7 +126,7 @@ public void appCDS(ContainerImageConfig containerImageConfig, CompiledJavaVersio producer.produce(new AppCDSContainerImageBuildItem(determineBaseJvmImage(jibConfig, compiledJavaVersion))); } - private String determineBaseJvmImage(JibConfig jibConfig, CompiledJavaVersionBuildItem compiledJavaVersion) { + private String determineBaseJvmImage(ContainerImageJibConfig jibConfig, CompiledJavaVersionBuildItem compiledJavaVersion) { if (jibConfig.baseJvmImage.isPresent()) { return jibConfig.baseJvmImage.get(); } @@ -139,7 +139,7 @@ private String determineBaseJvmImage(JibConfig jibConfig, CompiledJavaVersionBui } @BuildStep(onlyIf = { IsNormal.class, JibBuild.class }, onlyIfNot = NativeBuild.class) - public void buildFromJar(ContainerImageConfig containerImageConfig, JibConfig jibConfig, + public void buildFromJar(ContainerImageConfig containerImageConfig, ContainerImageJibConfig jibConfig, PackageConfig packageConfig, ContainerImageInfoBuildItem containerImage, JarBuildItem sourceJar, @@ -192,7 +192,7 @@ public void buildFromJar(ContainerImageConfig containerImageConfig, JibConfig ji } @BuildStep(onlyIf = { IsNormal.class, JibBuild.class, NativeBuild.class }) - public void buildFromNative(ContainerImageConfig containerImageConfig, JibConfig jibConfig, + public void buildFromNative(ContainerImageConfig containerImageConfig, ContainerImageJibConfig jibConfig, ContainerImageInfoBuildItem containerImage, NativeImageBuildItem nativeImage, OutputTargetBuildItem outputTarget, @@ -232,7 +232,8 @@ public void buildFromNative(ContainerImageConfig containerImageConfig, JibConfig } private JibContainer containerize(ContainerImageConfig containerImageConfig, - JibConfig jibConfig, ContainerImageInfoBuildItem containerImage, JibContainerBuilder jibContainerBuilder, + ContainerImageJibConfig jibConfig, ContainerImageInfoBuildItem containerImage, + JibContainerBuilder jibContainerBuilder, boolean pushRequested) { Containerizer containerizer = createContainerizer(containerImageConfig, jibConfig, containerImage, pushRequested); @@ -266,7 +267,7 @@ private JibContainer containerize(ContainerImageConfig containerImageConfig, } private Containerizer createContainerizer(ContainerImageConfig containerImageConfig, - JibConfig jibConfig, ContainerImageInfoBuildItem containerImageInfo, + ContainerImageJibConfig jibConfig, ContainerImageInfoBuildItem containerImageInfo, boolean pushRequested) { Containerizer containerizer; ImageReference imageReference = ImageReference.of(containerImageInfo.getRegistry().orElse(null), @@ -310,7 +311,8 @@ private Containerizer createContainerizer(ContainerImageConfig containerImageCon return containerizer; } - private void writeOutputFiles(JibContainer jibContainer, JibConfig jibConfig, OutputTargetBuildItem outputTarget) { + private void writeOutputFiles(JibContainer jibContainer, ContainerImageJibConfig jibConfig, + OutputTargetBuildItem outputTarget) { doWriteOutputFile(outputTarget, Paths.get(jibConfig.imageDigestFile), jibContainer.getDigest().toString()); doWriteOutputFile(outputTarget, Paths.get(jibConfig.imageIdFile), jibContainer.getImageId().toString()); } @@ -374,7 +376,7 @@ private Logger.Level toJBossLoggingLevel(LogEvent.Level level) { *
  • app
  • * */ - private JibContainerBuilder createContainerBuilderFromFastJar(String baseJvmImage, JibConfig jibConfig, + private JibContainerBuilder createContainerBuilderFromFastJar(String baseJvmImage, ContainerImageJibConfig jibConfig, ContainerImageConfig containerImageConfig, JarBuildItem sourceJarBuildItem, CurateOutcomeBuildItem curateOutcome, List containerImageLabels, @@ -534,7 +536,7 @@ private JibContainerBuilder createContainerBuilderFromFastJar(String baseJvmImag workDirInContainer, "fast-jar-quarkus-app", isMutableJar, modificationTime); addLayer(jibContainerBuilder, Collections.singletonList(componentsPath.resolve(JarResultBuildStep.QUARKUS)), workDirInContainer, "fast-jar-quarkus", isMutableJar, modificationTime); - if (JibConfig.DEFAULT_WORKING_DIR.equals(jibConfig.workingDirectory)) { + if (ContainerImageJibConfig.DEFAULT_WORKING_DIR.equals(jibConfig.workingDirectory)) { // this layer ensures that the working directory is writeable // see https://github.com/GoogleContainerTools/jib/issues/1270 // TODO: is this needed for all working directories? @@ -615,7 +617,8 @@ private void mayInheritEntrypoint(JibContainerBuilder jibContainerBuilder, List< } } - private List determineEffectiveJvmArguments(JibConfig jibConfig, Optional appCDSResult) { + private List determineEffectiveJvmArguments(ContainerImageJibConfig jibConfig, + Optional appCDSResult) { List effectiveJvmArguments = new ArrayList<>(jibConfig.jvmArguments); jibConfig.jvmAdditionalArguments.ifPresent(effectiveJvmArguments::addAll); if (appCDSResult.isPresent()) { @@ -633,15 +636,15 @@ private List determineEffectiveJvmArguments(JibConfig jibConfig, Optiona return effectiveJvmArguments; } - private void setUser(JibConfig jibConfig, JibContainerBuilder jibContainerBuilder) { + private void setUser(ContainerImageJibConfig jibConfig, JibContainerBuilder jibContainerBuilder) { jibConfig.user.ifPresent(jibContainerBuilder::setUser); } - private void setPlatforms(JibConfig jibConfig, JibContainerBuilder jibContainerBuilder) { + private void setPlatforms(ContainerImageJibConfig jibConfig, JibContainerBuilder jibContainerBuilder) { jibConfig.platforms.map(PlatformHelper::parse).ifPresent(jibContainerBuilder::setPlatforms); } - private JibContainerBuilder createContainerBuilderFromLegacyJar(String baseJvmImage, JibConfig jibConfig, + private JibContainerBuilder createContainerBuilderFromLegacyJar(String baseJvmImage, ContainerImageJibConfig jibConfig, ContainerImageConfig containerImageConfig, JarBuildItem sourceJarBuildItem, OutputTargetBuildItem outputTargetBuildItem, @@ -696,7 +699,8 @@ private JibContainerBuilder createContainerBuilderFromLegacyJar(String baseJvmIm } } - private JibContainerBuilder createContainerBuilderFromNative(JibConfig jibConfig, ContainerImageConfig containerImageConfig, + private JibContainerBuilder createContainerBuilderFromNative(ContainerImageJibConfig jibConfig, + ContainerImageConfig containerImageConfig, NativeImageBuildItem nativeImageBuildItem, List containerImageLabels) { List entrypoint; @@ -737,7 +741,7 @@ private JibContainerBuilder createContainerBuilderFromNative(JibConfig jibConfig } } - private Map getEnvironmentVariables(JibConfig jibConfig) { + private Map getEnvironmentVariables(ContainerImageJibConfig jibConfig) { Map original = jibConfig.environmentVariables; if (original.isEmpty()) { return original; @@ -788,7 +792,7 @@ private void handleExtraFiles(OutputTargetBuildItem outputTarget, JibContainerBu } } - private Map allLabels(JibConfig jibConfig, ContainerImageConfig containerImageConfig, + private Map allLabels(ContainerImageJibConfig jibConfig, ContainerImageConfig containerImageConfig, List containerImageLabels) { if (containerImageLabels.isEmpty() && containerImageConfig.labels.isEmpty()) { return Collections.emptyMap(); diff --git a/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftConfig.java b/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/ContainerImageOpenshiftConfig.java similarity index 98% rename from extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftConfig.java rename to extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/ContainerImageOpenshiftConfig.java index 7b1e9d4be07fa..ba12fab0899d6 100644 --- a/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftConfig.java +++ b/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/ContainerImageOpenshiftConfig.java @@ -12,8 +12,8 @@ import io.quarkus.runtime.annotations.ConfigPhase; import io.quarkus.runtime.annotations.ConfigRoot; -@ConfigRoot(phase = ConfigPhase.BUILD_TIME) -public class OpenshiftConfig { +@ConfigRoot(name = "openshift", phase = ConfigPhase.BUILD_TIME) +public class ContainerImageOpenshiftConfig { public static final String DEFAULT_BASE_JVM_JDK11_IMAGE = "registry.access.redhat.com/ubi8/openjdk-11:1.16"; public static final String DEFAULT_BASE_JVM_JDK17_IMAGE = "registry.access.redhat.com/ubi8/openjdk-17:1.16"; diff --git a/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java b/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java index ca73c5cbb81db..5223670222e67 100644 --- a/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java +++ b/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftProcessor.java @@ -95,11 +95,11 @@ public AvailableContainerImageExtensionBuildItem availability() { } @BuildStep(onlyIf = { OpenshiftBuild.class }, onlyIfNot = NativeBuild.class) - public void openshiftPrepareJvmDockerBuild(OpenshiftConfig openshiftConfig, + public void openshiftPrepareJvmDockerBuild(ContainerImageOpenshiftConfig openshiftConfig, S2iConfig s2iConfig, OutputTargetBuildItem out, BuildProducer decorator) { - OpenshiftConfig config = mergeConfig(openshiftConfig, s2iConfig); + ContainerImageOpenshiftConfig config = mergeConfig(openshiftConfig, s2iConfig); if (config.buildStrategy == BuildStrategy.DOCKER) { decorator.produce(new DecoratorBuildItem(new ApplyDockerfileToBuildConfigDecorator(null, findMainSourcesRoot(out.getOutputDirectory()).getValue().resolve(openshiftConfig.jvmDockerfile)))); @@ -110,11 +110,11 @@ public void openshiftPrepareJvmDockerBuild(OpenshiftConfig openshiftConfig, } @BuildStep(onlyIf = { OpenshiftBuild.class, NativeBuild.class }) - public void openshiftPrepareNativeDockerBuild(OpenshiftConfig openshiftConfig, + public void openshiftPrepareNativeDockerBuild(ContainerImageOpenshiftConfig openshiftConfig, S2iConfig s2iConfig, OutputTargetBuildItem out, BuildProducer decorator) { - OpenshiftConfig config = mergeConfig(openshiftConfig, s2iConfig); + ContainerImageOpenshiftConfig config = mergeConfig(openshiftConfig, s2iConfig); if (config.buildStrategy == BuildStrategy.DOCKER) { decorator.produce(new DecoratorBuildItem(new ApplyDockerfileToBuildConfigDecorator(null, findMainSourcesRoot(out.getOutputDirectory()).getValue().resolve(openshiftConfig.nativeDockerfile)))); @@ -125,7 +125,7 @@ public void openshiftPrepareNativeDockerBuild(OpenshiftConfig openshiftConfig, } @BuildStep(onlyIf = { IsNormalNotRemoteDev.class, OpenshiftBuild.class }, onlyIfNot = NativeBuild.class) - public void openshiftRequirementsJvm(OpenshiftConfig openshiftConfig, + public void openshiftRequirementsJvm(ContainerImageOpenshiftConfig openshiftConfig, S2iConfig s2iConfig, CurateOutcomeBuildItem curateOutcomeBuildItem, OutputTargetBuildItem out, @@ -137,11 +137,11 @@ public void openshiftRequirementsJvm(OpenshiftConfig openshiftConfig, BuildProducer builderImageProducer, BuildProducer commandProducer) { - OpenshiftConfig config = mergeConfig(openshiftConfig, s2iConfig); + ContainerImageOpenshiftConfig config = mergeConfig(openshiftConfig, s2iConfig); String outputJarFileName = jarBuildItem.getPath().getFileName().toString(); String jarFileName = config.jarFileName.orElse(outputJarFileName); String baseJvmImage = config.baseJvmImage - .orElse(OpenshiftConfig.getDefaultJvmImage(compiledJavaVersion.getJavaVersion())); + .orElse(ContainerImageOpenshiftConfig.getDefaultJvmImage(compiledJavaVersion.getJavaVersion())); boolean hasCustomJarPath = config.jarFileName.isPresent() || config.jarDirectory.isPresent(); boolean hasCustomJvmArguments = config.jvmArguments.isPresent(); @@ -180,7 +180,7 @@ public void openshiftRequirementsJvm(OpenshiftConfig openshiftConfig, } @BuildStep(onlyIf = { IsNormalNotRemoteDev.class, OpenshiftBuild.class, NativeBuild.class }) - public void openshiftRequirementsNative(OpenshiftConfig openshiftConfig, + public void openshiftRequirementsNative(ContainerImageOpenshiftConfig openshiftConfig, S2iConfig s2iConfig, CurateOutcomeBuildItem curateOutcomeBuildItem, OutputTargetBuildItem out, @@ -190,8 +190,8 @@ public void openshiftRequirementsNative(OpenshiftConfig openshiftConfig, BuildProducer builderImageProducer, BuildProducer commandProducer) { - OpenshiftConfig config = mergeConfig(openshiftConfig, s2iConfig); - boolean usingDefaultBuilder = ImageUtil.getRepository(OpenshiftConfig.DEFAULT_BASE_NATIVE_IMAGE) + ContainerImageOpenshiftConfig config = mergeConfig(openshiftConfig, s2iConfig); + boolean usingDefaultBuilder = ImageUtil.getRepository(ContainerImageOpenshiftConfig.DEFAULT_BASE_NATIVE_IMAGE) .equals(ImageUtil.getRepository(config.baseNativeImage)); String outputNativeBinaryFileName = nativeImage.getPath().getFileName().toString(); @@ -203,7 +203,7 @@ public void openshiftRequirementsNative(OpenshiftConfig openshiftConfig, //The default openshift builder for native builds, renames the native binary. //To make things easier for the user, we need to handle it. if (usingDefaultBuilder && !config.nativeBinaryFileName.isPresent()) { - nativeBinaryFileName = OpenshiftConfig.DEFAULT_NATIVE_TARGET_FILENAME; + nativeBinaryFileName = ContainerImageOpenshiftConfig.DEFAULT_NATIVE_TARGET_FILENAME; } else { nativeBinaryFileName = config.nativeBinaryFileName.orElse(outputNativeBinaryFileName); } @@ -239,7 +239,7 @@ public void openshiftRequirementsNative(OpenshiftConfig openshiftConfig, @BuildStep(onlyIf = { OpenshiftBuild.class }) public void configureExternalRegistry(ApplicationInfoBuildItem applicationInfo, - OpenshiftConfig openshiftConfig, + ContainerImageOpenshiftConfig openshiftConfig, ContainerImageInfoBuildItem containerImageInfo, BuildProducer decorator) { containerImageInfo.registry.ifPresent(registry -> { @@ -267,7 +267,7 @@ public void configureExternalRegistry(ApplicationInfoBuildItem applicationInfo, } @BuildStep(onlyIf = { IsNormalNotRemoteDev.class, OpenshiftBuild.class }, onlyIfNot = NativeBuild.class) - public void openshiftBuildFromJar(OpenshiftConfig openshiftConfig, + public void openshiftBuildFromJar(ContainerImageOpenshiftConfig openshiftConfig, S2iConfig s2iConfig, ContainerImageConfig containerImageConfig, KubernetesClientBuildItem kubernetesClientBuilder, @@ -281,7 +281,7 @@ public void openshiftBuildFromJar(OpenshiftConfig openshiftConfig, // used to ensure that the jar has been built JarBuildItem jar) { - OpenshiftConfig config = mergeConfig(openshiftConfig, s2iConfig); + ContainerImageOpenshiftConfig config = mergeConfig(openshiftConfig, s2iConfig); if (containerImageConfig.isBuildExplicitlyDisabled()) { return; } @@ -339,7 +339,7 @@ private String getContextRoot(String outputDirName, boolean isFastJar, BuildStra } @BuildStep(onlyIf = { IsNormalNotRemoteDev.class, OpenshiftBuild.class, NativeBuild.class }) - public void openshiftBuildFromNative(OpenshiftConfig openshiftConfig, S2iConfig s2iConfig, + public void openshiftBuildFromNative(ContainerImageOpenshiftConfig openshiftConfig, S2iConfig s2iConfig, ContainerImageConfig containerImageConfig, KubernetesClientBuildItem kubernetesClientBuilder, ContainerImageInfoBuildItem containerImage, @@ -351,7 +351,7 @@ public void openshiftBuildFromNative(OpenshiftConfig openshiftConfig, S2iConfig BuildProducer containerImageBuilder, NativeImageBuildItem nativeImage) { - OpenshiftConfig config = mergeConfig(openshiftConfig, s2iConfig); + ContainerImageOpenshiftConfig config = mergeConfig(openshiftConfig, s2iConfig); if (containerImageConfig.isBuildExplicitlyDisabled()) { return; @@ -392,7 +392,7 @@ public void openshiftBuildFromNative(OpenshiftConfig openshiftConfig, S2iConfig public static void createContainerImage(KubernetesClientBuilder kubernetesClientBuilder, GeneratedFileSystemResourceBuildItem openshiftManifests, - OpenshiftConfig openshiftConfig, + ContainerImageOpenshiftConfig openshiftConfig, String base, Path output, Path... additional) { @@ -456,7 +456,7 @@ private static void applyOpenshiftResources(OpenShiftClient client, List buildResources, File binaryFile, - OpenshiftConfig openshiftConfig, KubernetesClientBuilder kubernetesClientBuilder) { + ContainerImageOpenshiftConfig openshiftConfig, KubernetesClientBuilder kubernetesClientBuilder) { distinct(buildResources).stream().filter(i -> i instanceof BuildConfig).map(i -> (BuildConfig) i) .forEach(bc -> { Build build = startOpenshiftBuild(bc, binaryFile, openshiftConfig, kubernetesClientBuilder); @@ -474,7 +474,7 @@ private static void openshiftBuild(List buildResources, File binary * @param kubernetesClientBuilder The kubernetes client builder */ private static Build startOpenshiftBuild(BuildConfig buildConfig, File binaryFile, - OpenshiftConfig openshiftConfig, KubernetesClientBuilder kubernetesClientBuilder) { + ContainerImageOpenshiftConfig openshiftConfig, KubernetesClientBuilder kubernetesClientBuilder) { try (KubernetesClient kubernetesClient = kubernetesClientBuilder.build()) { OpenShiftClient client = toOpenshiftClient(kubernetesClient); try { @@ -495,7 +495,7 @@ private static Build startOpenshiftBuild(BuildConfig buildConfig, File binaryFil } } - private static void waitForOpenshiftBuild(Build build, OpenshiftConfig openshiftConfig, + private static void waitForOpenshiftBuild(Build build, ContainerImageOpenshiftConfig openshiftConfig, KubernetesClientBuilder kubernetesClientBuilder) { while (isNew(build) || isPending(build) || isRunning(build)) { diff --git a/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftUtils.java b/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftUtils.java index e2bdb427a915c..43341ba0cedaa 100644 --- a/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftUtils.java +++ b/extensions/container-image/container-image-openshift/deployment/src/main/java/io/quarkus/container/image/openshift/deployment/OpenshiftUtils.java @@ -87,14 +87,15 @@ public void visit(SourceBuildStrategyFluent strategy) { } /** - * Merges {@link OpenshiftConfig} with {@link S2iConfig} prioritizing in the former. + * Merges {@link ContainerImageOpenshiftConfig} with {@link S2iConfig} prioritizing in the former. * * @param openshiftConfig the Openshift config * @param s2iConfig the s2i config - * @return an instance of {@link OpenshiftConfig} with the merged configuration. + * @return an instance of {@link ContainerImageOpenshiftConfig} with the merged configuration. */ - public static OpenshiftConfig mergeConfig(OpenshiftConfig openshiftConfig, S2iConfig s2iConfig) { - OpenshiftConfig result = openshiftConfig != null ? openshiftConfig : new OpenshiftConfig(); + public static ContainerImageOpenshiftConfig mergeConfig(ContainerImageOpenshiftConfig openshiftConfig, + S2iConfig s2iConfig) { + ContainerImageOpenshiftConfig result = openshiftConfig != null ? openshiftConfig : new ContainerImageOpenshiftConfig(); if (s2iConfig == null) { return result; } diff --git a/extensions/container-image/container-image-s2i/deployment/src/main/java/io/quarkus/container/image/s2i/deployment/S2iConfig.java b/extensions/container-image/container-image-s2i/deployment/src/main/java/io/quarkus/container/image/s2i/deployment/ContainerImageS2iConfig.java similarity index 97% rename from extensions/container-image/container-image-s2i/deployment/src/main/java/io/quarkus/container/image/s2i/deployment/S2iConfig.java rename to extensions/container-image/container-image-s2i/deployment/src/main/java/io/quarkus/container/image/s2i/deployment/ContainerImageS2iConfig.java index 42ec6eec02eb1..361aba9082290 100644 --- a/extensions/container-image/container-image-s2i/deployment/src/main/java/io/quarkus/container/image/s2i/deployment/S2iConfig.java +++ b/extensions/container-image/container-image-s2i/deployment/src/main/java/io/quarkus/container/image/s2i/deployment/ContainerImageS2iConfig.java @@ -10,8 +10,8 @@ import io.quarkus.runtime.annotations.ConfigPhase; import io.quarkus.runtime.annotations.ConfigRoot; -@ConfigRoot(phase = ConfigPhase.BUILD_TIME) -public class S2iConfig { +@ConfigRoot(name = "s2i", phase = ConfigPhase.BUILD_TIME) +public class ContainerImageS2iConfig { public static final String DEFAULT_BASE_JVM_JDK11_IMAGE = "registry.access.redhat.com/ubi8/openjdk-11"; public static final String DEFAULT_BASE_JVM_JDK17_IMAGE = "registry.access.redhat.com/ubi8/openjdk-17"; diff --git a/extensions/container-image/container-image-s2i/deployment/src/main/java/io/quarkus/container/image/s2i/deployment/S2iProcessor.java b/extensions/container-image/container-image-s2i/deployment/src/main/java/io/quarkus/container/image/s2i/deployment/S2iProcessor.java index 8dcb512328c26..8d93544dfc221 100644 --- a/extensions/container-image/container-image-s2i/deployment/src/main/java/io/quarkus/container/image/s2i/deployment/S2iProcessor.java +++ b/extensions/container-image/container-image-s2i/deployment/src/main/java/io/quarkus/container/image/s2i/deployment/S2iProcessor.java @@ -82,7 +82,7 @@ public AvailableContainerImageExtensionBuildItem availability() { } @BuildStep(onlyIf = { IsNormalNotRemoteDev.class, S2iBuild.class }, onlyIfNot = NativeBuild.class) - public void s2iRequirementsJvm(S2iConfig s2iConfig, + public void s2iRequirementsJvm(ContainerImageS2iConfig s2iConfig, CurateOutcomeBuildItem curateOutcomeBuildItem, OutputTargetBuildItem out, PackageConfig packageConfig, @@ -104,7 +104,8 @@ public void s2iRequirementsJvm(S2iConfig s2iConfig, String jarFileName = s2iConfig.jarFileName.orElse(outputJarFileName); String jarDirectory = s2iConfig.jarDirectory; String pathToJar = concatUnixPaths(jarDirectory, jarFileName); - String baseJvmImage = s2iConfig.baseJvmImage.orElse(S2iConfig.getDefaultJvmImage(compiledJavaVersion.getJavaVersion())); + String baseJvmImage = s2iConfig.baseJvmImage + .orElse(ContainerImageS2iConfig.getDefaultJvmImage(compiledJavaVersion.getJavaVersion())); builderImageProducer.produce(new BaseImageInfoBuildItem(baseJvmImage)); Optional baseImage = S2iBaseJavaImage.findMatching(baseJvmImage); @@ -128,7 +129,7 @@ public void s2iRequirementsJvm(S2iConfig s2iConfig, } @BuildStep(onlyIf = { IsNormalNotRemoteDev.class, S2iBuild.class, NativeBuild.class }) - public void s2iRequirementsNative(S2iConfig s2iConfig, + public void s2iRequirementsNative(ContainerImageS2iConfig s2iConfig, CurateOutcomeBuildItem curateOutcomeBuildItem, OutputTargetBuildItem out, PackageConfig packageConfig, @@ -137,7 +138,7 @@ public void s2iRequirementsNative(S2iConfig s2iConfig, BuildProducer builderImageProducer, BuildProducer commandProducer) { - boolean usingDefaultBuilder = ImageUtil.getRepository(S2iConfig.DEFAULT_BASE_NATIVE_IMAGE) + boolean usingDefaultBuilder = ImageUtil.getRepository(ContainerImageS2iConfig.DEFAULT_BASE_NATIVE_IMAGE) .equals(ImageUtil.getRepository(s2iConfig.baseNativeImage)); String outputNativeBinaryFileName = nativeImage.getPath().getFileName().toString(); @@ -146,7 +147,7 @@ public void s2iRequirementsNative(S2iConfig s2iConfig, //The default s2i builder for native builds, renames the native binary. //To make things easier for the user, we need to handle it. if (usingDefaultBuilder && !s2iConfig.nativeBinaryFileName.isPresent()) { - nativeBinaryFileName = S2iConfig.DEFAULT_NATIVE_TARGET_FILENAME; + nativeBinaryFileName = ContainerImageS2iConfig.DEFAULT_NATIVE_TARGET_FILENAME; } else { nativeBinaryFileName = s2iConfig.nativeBinaryFileName.orElse(outputNativeBinaryFileName); } @@ -170,7 +171,7 @@ public void s2iRequirementsNative(S2iConfig s2iConfig, } @BuildStep(onlyIf = { IsNormalNotRemoteDev.class, S2iBuild.class }, onlyIfNot = NativeBuild.class) - public void s2iBuildFromJar(S2iConfig s2iConfig, ContainerImageConfig containerImageConfig, + public void s2iBuildFromJar(ContainerImageS2iConfig s2iConfig, ContainerImageConfig containerImageConfig, KubernetesClientBuildItem kubernetesClientBuilder, ContainerImageInfoBuildItem containerImage, ArchiveRootBuildItem archiveRoot, OutputTargetBuildItem out, PackageConfig packageConfig, @@ -214,7 +215,7 @@ public void s2iBuildFromJar(S2iConfig s2iConfig, ContainerImageConfig containerI } @BuildStep(onlyIf = { IsNormalNotRemoteDev.class, S2iBuild.class, NativeBuild.class }) - public void s2iBuildFromNative(S2iConfig s2iConfig, ContainerImageConfig containerImageConfig, + public void s2iBuildFromNative(ContainerImageS2iConfig s2iConfig, ContainerImageConfig containerImageConfig, KubernetesClientBuildItem kubernetesClientBuilder, ContainerImageInfoBuildItem containerImage, ArchiveRootBuildItem archiveRoot, OutputTargetBuildItem out, PackageConfig packageConfig, @@ -259,7 +260,7 @@ public void s2iBuildFromNative(S2iConfig s2iConfig, ContainerImageConfig contain public static void createContainerImage(KubernetesClient kubernetesClient, GeneratedFileSystemResourceBuildItem openshiftManifests, - S2iConfig s2iConfig, + ContainerImageS2iConfig s2iConfig, Path output, Path... additional) { @@ -331,7 +332,7 @@ private static void applyS2iResources(OpenShiftClient client, List } private static void s2iBuild(OpenShiftClient client, List buildResources, File binaryFile, - S2iConfig s2iConfig) { + ContainerImageS2iConfig s2iConfig) { distinct(buildResources).stream().filter(i -> i instanceof BuildConfig).map(i -> (BuildConfig) i) .forEach(bc -> s2iBuild(client, bc, binaryFile, s2iConfig)); } @@ -345,7 +346,8 @@ private static void s2iBuild(OpenShiftClient client, List buildReso * @param binaryFile The binary file * @param s2iConfig The s2i configuration */ - private static void s2iBuild(OpenShiftClient client, BuildConfig buildConfig, File binaryFile, S2iConfig s2iConfig) { + private static void s2iBuild(OpenShiftClient client, BuildConfig buildConfig, File binaryFile, + ContainerImageS2iConfig s2iConfig) { Build build; try { build = client.buildConfigs().withName(buildConfig.getMetadata().getName()) @@ -375,7 +377,8 @@ private static void s2iBuild(OpenShiftClient client, BuildConfig buildConfig, Fi } } - private static void waitForBuildComplete(OpenShiftClient client, S2iConfig s2iConfig, String buildName, Closeable watch) { + private static void waitForBuildComplete(OpenShiftClient client, ContainerImageS2iConfig s2iConfig, String buildName, + Closeable watch) { CountDownLatch latch = new CountDownLatch(1); ExecutorService executor = Executors.newSingleThreadExecutor(); executor.execute(() -> {