Chapter 15. Patching Fuse on OpenShift
You might need to perform one or more of the following tasks to bring the Fuse on OpenShift product up to the latest patch level:
- Patch the Fuse on OpenShift Images
- Update the Fuse on OpenShift images on your OpenShift server, so that new application builds are based on patched versions of the Fuse base images.
- Patch Application Dependencies using BOM
- Update the dependencies in your project POM file, so that your application uses patched versions of the Maven artifacts.
- Patch the Fuse on OpenShift Templates
- Update the Fuse on OpenShift templates on your OpenShift server, so that new projects created with the Fuse on OpenShift templates use patched versions of the Maven artifacts.
15.1. Important note on BOMs and Maven dependencies
In the context of Fuse on OpenShift, applications are built entirely using Maven artifacts downloaded from the Red Hat Maven repositories. Hence, to patch your application code, all that you need to do is to edit your project’s POM file, changing the Maven dependencies to use the appropriate Fuse on OpenShift patch version.
It is important to upgrade all of the Maven dependencies for Fuse on OpenShift together, so that your project uses dependencies that are all from the same patch version. The Fuse on OpenShift project consists of a carefully curated set of Maven artifacts that are built and tested together. If you try to mix and match Maven artifacts from different Fuse on OpenShift patch levels, you could end up with a configuration that is untested and unsupported by Red Hat. The easiest way to avoid this scenario is to use a Bill of Materials (BOM) file in Maven, which defines the versions of all the Maven artifacts supported by Fuse on OpenShift. When you update the version of a BOM file, you automatically update the versions for all the Fuse on OpenShift Maven artifacts in your project’s POM.
The POM file that is generated by a Fuse on OpenShift Maven archetype or by a Fuse on OpenShift template has a standard layout that uses a BOM file and defines the versions of certain required plugins. It is recommended that you stick to this standard layout in your own applications, because this makes it much easier to patch and upgrade your application’s dependencies.
15.2. Patching the Fuse on OpenShift images
The Fuse on OpenShift images are updated independently of the main Fuse product. If any patches are required for the Fuse on OpenShift images, updated images will be made available on the standard Fuse on OpenShift image streams and you can download the updated images from registry.redhat.io
. Fuse on OpenShift provides the following image streams (identified by their OpenShift image stream name):
-
fuse-java-openshift-rhel8
-
fuse-java-openshift-jdk11-rhel8
-
fuse-karaf-openshift-rhel8
-
fuse-eap-openshift-jdk8-rhel7
-
fuse-eap-openshift-jdk11-rhel8
-
fuse-console-rhel8
-
fuse-apicurito-generator-rhel8
-
fuse-apicurito-rhel8
Procedure
Fuse on OpenShift image streams are normally installed on the
openshift
project on the OpenShift server. To check the status of the Fuse on OpenShift images on OpenShift, login to OpenShift as an administrator and enter the following command:$ oc get is -n openshift NAME DOCKER REPO TAGS UPDATED fuse-console-rhel8 172.30.1.1:5000/openshift/fuse7/fuse-console-rhel8 1.6,1.7,1.8,1.9,1.10,1.11,1.12,1.13 About an hour ago fuse7-eap-openshift-jdk8-rhel7 172.30.1.1:5000/openshift/fuse7/fuse-eap-openshift-jdk8-rhel7 1.6,1.7,1.8,1.9,1.10,1.11,1.12,1.13 About an hour ago fuse7-eap-openshift-jdk11-rhel8 172.30.1.1:5000/openshift/fuse7/fuse-eap-openshift-jdk11-rhel8 1.6,1.7,1.8,1.9,1.10,1.11,1.12,1.13 About an hour ago fuse7-java-openshift-rhel8 172.30.1.1:5000/openshift/fuse7/fuse-java-openshift-rhel8 1.6,1.7,1.8,1.9,1.10,1.11,1.12,1.13 About an hour ago fuse7-java-openshift-jdk11-rhel8 172.30.1.1:5000/openshift/fuse7/fuse-java-openshift-jdk11-rhel8 1.6,1.7,1.8,1.9,1.10,1.11,1.12,1.13 About an hour ago fuse7-karaf-openshift-rhel8 172.30.1.1:5000/openshift/fuse7/fuse-karaf-openshift-rhel8 1.6,1.7,1.8,1.9,1.10,1.11,1.12,1.13 About an hour ago fuse-apicurito-generator-rhel8 172.30.1.1:5000/openshift/fuse7/fuse-apicurito-generator-rhel8 1.6,1.7,1.8,1.9,1.10,1.11,1.12,1.13 About an hour ago apicurito-ui-rhel8 172.30.1.1:5000/openshift/fuse7/apicurito-ui-rhel8 1.6,1.7,1.8,1.9,1.10,1.11,1.12,1.13 About an hour ago
You can now update each image stream one at a time:
oc import-image -n openshift fuse7/fuse7-java-openshift-rhel8:1.13 oc import-image -n openshift fuse7/fuse7-java-openshift-jdk11-rhel8:1.13 oc import-image -n openshift fuse7/fuse7-karaf-openshift-rhel8:1.13 oc import-image -n openshift fuse7/fuse7-eap-openshift-jdk8-rhel7:1.13 oc import-image -n openshift fuse7/fuse7-eap-openshift--jdk11-rhel8:1.13 oc import-image -n openshift fuse7/fuse7-console-rhel8:1.13 oc import-image -n openshift fuse7/apicurito-ui-rhel8:1.13 oc import-image -n openshift fuse7/fuse-apicurito-generator-rhel8:1.13
The version tags in the image stream have the form 1.9-<BUILDNUMBER>
. When you specify the tag as 1.9
, you will get the latest build in the 1.9
stream.
You can also configure your Fuse applications so that a rebuild is automatically triggered whenever a new Fuse on OpenShift image becomes available. For details, see the section Triggering and modifying builds in the Builds OpenShift Container Platform documentation_.
15.3. Patching the Fuse on OpenShift templates
You must update the Fuse on OpenShift templates to the latest patch level, to ensure that new template-based projects are built using the correct patched dependencies.
Procedure
You need administrator privileges to update the Fuse on OpenShift templates. Log in to the OpenShift Server as an administrator, as follows:
oc login URL -u ADMIN_USER -p ADMIN_PASS
Where
URL
is the URL of the OpenShift server andADMIN_USER
,ADMIN_PASS
are the credentials of an administrator account on the OpenShift server.Install the patched Fuse on OpenShift templates. Enter the following commands at a command prompt:
BASEURL=https://raw.githubusercontent.com/jboss-fuse/application-templates/application-templates-2.1.0.fuse-7_13_0-00014-redhat-00001 oc replace --force -n openshift -f ${BASEURL}/quickstarts/eap-camel-amq-template.json oc replace --force -n openshift -f ${BASEURL}/quickstarts/eap-camel-cdi-template.json oc replace --force -n openshift -f ${BASEURL}/quickstarts/eap-camel-cxf-jaxrs-template.json oc replace --force -n openshift -f ${BASEURL}/quickstarts/eap-camel-cxf-jaxws-template.json oc replace --force -n openshift -f ${BASEURL}/quickstarts/karaf-camel-amq-template.json oc replace --force -n openshift -f ${BASEURL}/quickstarts/karaf-camel-log-template.json oc replace --force -n openshift -f ${BASEURL}/quickstarts/karaf-camel-rest-sql-template.json oc replace --force -n openshift -f ${BASEURL}/quickstarts/karaf-cxf-rest-template.json oc replace --force -n openshift -f ${BASEURL}/quickstarts/spring-boot-camel-template.json oc replace --force -n openshift -f ${BASEURL}/quickstarts/spring-boot-camel-amq-template.json oc replace --force -n openshift -f ${BASEURL}/quickstarts/spring-boot-camel-config-template.json oc replace --force -n openshift -f ${BASEURL}/quickstarts/spring-boot-camel-drools-template.json oc replace --force -n openshift -f ${BASEURL}/quickstarts/spring-boot-camel-infinispan-template.json oc replace --force -n openshift -f ${BASEURL}/quickstarts/spring-boot-camel-xml-template.json oc replace --force -n openshift -f ${BASEURL}/quickstarts/spring-boot-cxf-jaxrs-template.json oc replace --force -n openshift -f ${BASEURL}/quickstarts/spring-boot-cxf-jaxws-template.json
NoteThe
BASEURL
points at the GA branch of the Git repository that stores the quickstart templates and it will always have the latest templates atHEAD
. So, any time you run the preceding commands, you will get the latest version of the templates.
15.4. Patch application dependencies using BOM
If your application pom.xml
file is configured to use the new-style BOM, follow the instructions in this section to upgrade the Maven dependencies.
15.4.1. Updating dependencies in a Spring Boot application
The following code fragment shows the standard layout of a POM file for a Spring Boot application in Fuse on OpenShift, highlighting some important property settings:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <project ...> ... <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <fuse.version>7.13.0.fuse-7_13_0-00012-redhat-00001</fuse.version> ... </properties> <dependencyManagement> <dependencies> <dependency> <groupId>org.jboss.redhat-fuse</groupId> <artifactId>fuse-springboot-bom</artifactId> <version>${fuse.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> ... <build> ... <plugins> <!-- Core plugins --> ... <plugin> <groupId>org.jboss.redhat-fuse</groupId> <artifactId>spring-boot-maven-plugin</artifactId> ... <version>${fuse.version}</version> </plugin> </plugins> </build> <profiles> <profile> <id>openshift</id> <build> <plugins> <plugin> <groupId>org.jboss.redhat-fuse</groupId> <artifactId>openshift-maven-plugin</artifactId> ... <version>${fuse.version}</version> </plugin> </plugins> </build> </profile> </profiles> </project>
When it comes to patching or upgrading the application, the following version settings are important:
fuse.version
-
Defines the version of the new-style
fuse-springboot-bom
BOM, as well as the versions of theopenshift-maven-plugin
plugin and thespring-boot-maven-plugin
plugin.
15.4.2. Updating dependencies in a Karaf application
The following code fragment shows the standard layout of a POM file for a Karaf application in Fuse on OpenShift, highlighting some important property settings:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <project ...> ... <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <fuse.version>7.13.0.fuse-7_13_0-00012-redhat-00001</fuse.version> ... </properties> <dependencyManagement> <dependencies> <dependency> <groupId>org.jboss.redhat-fuse</groupId> <artifactId>fuse-karaf-bom</artifactId> <version>${fuse.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> ... <build> ... <plugins> ... <plugin> <groupId>org.jboss.redhat-fuse</groupId> <artifactId>karaf-maven-plugin</artifactId> <version>${fuse.version}</version> ... </plugin> ... <plugin> <groupId>org.jboss.redhat-fuse</groupId> <artifactId>openshift-maven-plugin</artifactId> <version>${fuse.version}</version> ... </plugin> </plugins> </build> </project>
When it comes to patching or upgrading the application, the following version settings are important:
fuse.version
-
Defines the version of the new-style
fuse-karaf-bom
BOM, as well as the versions of theopenshift-maven-plugin
plugin and thekaraf-maven-plugin
plugin.
15.4.3. Updating dependencies in a JBoss EAP application
The following code fragment shows the standard layout of a POM file for a JBoss EAP application in Fuse on OpenShift, highlighting some important property settings:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <project ...> ... <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <fuse.version>7.13.0.fuse-7_13_0-00012-redhat-00001</fuse.version> ... </properties> <!-- Dependency Management --> <dependencyManagement> <dependencies> <dependency> <groupId>org.jboss.redhat-fuse</groupId> <artifactId>fuse-eap-bom</artifactId> <version>${fuse.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> ... </project>
When it comes to patching or upgrading the application, the following version settings are important:
fuse.version
-
Defines the version of the
fuse-eap-bom
BOM file (which replaces the old-stylewildfly-camel-bom
BOM file). By updating the BOM version to a particular patch version, you are effectively updating all of the Fuse on JBoss EAP Maven dependencies as well.
15.5. Available BOM versions
The following table shows the new-style BOM versions corresponding to different patch releases of Red Hat Fuse.
Red Hat Fuse Release | org.jboss.redhat-fuse BOM Version |
---|---|
Red Hat Fuse 7.13 GA | 7.13.0.fuse-7_13_0-00012-redhat-00001 |
To upgrade your application POM to a specific Red Hat Fuse patch release, set the fuse.version
property to the corresponding BOM version.