Chapter 7. Known issues affecting required infrastructure components
Fabric8 Maven Plugin Issue #1640: Pushing an image into a custom repository during an s2i build with FMP 4.1.0 results in a
- Affected components and component versions
- This issues affects Fabric8 Maven Plugin 4.1.0.
Fabric8 Maven Plugin does not process
ImageConfigurationalso contains a
BuildImageConfiguration. Without a recognizable
BuildImageConfiguration, Fabric8 Maven Plugin repeatedly calls the s2i image generators to create another default
ImageConfigurationthat contains the expected
BuildImageConfiguration. This results in more than one
ImageConfigurationbeing specified for the given s2i build, which in turn results in a
DuplicateKeyExceptionwhen FMP attempts to push the image to the registry specified in the
pom.xmlconfiguration file. This leads to image build failures when a new image build is triggered by a change in the deployment configuration of a pod on OpenShift.
To prevent Fabric8 Maven Plugin form generating a duplicate
ImageConfiguration, place the image configuration inside a
buildsection in the
pom.xmlconfiguration file of your project, as shown in the examples below. This in turn prevents the
DuplicateKeyExceptionwhen new image build is triggered by a change in the deployment configuration of the pod.
<configuration> <images> <image> <name> artifactrepository.somecompany.com:18444/demo-boot/demo-boot:1.0 </name> <build> <from> fabric8/S2I_BASE_IMAGE_NAME </from> <assembly> <basedir> /deployments </basedir> <descriptorRef> artifact-with-dependencies </descriptorRef> </assembly> <env> <JAVA_LIB_DIR> /deployments </JAVA_LIB_DIR> <JAVA_MAIN_CLASS> org.example.class.name.Main </JAVA_MAIN_CLASS> </env> </build> ... </image> </images> ... </configurtation>