-
Language:
English
-
Language:
English
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
DuplicateKeyException
.- Affected components and component versions
- This issues affects Fabric8 Maven Plugin 4.1.0.
- Description
-
Fabric8 Maven Plugin does not process
ImageConfiguration
unlessImageConfiguration
also contains aBuildImageConfiguration
. Without a recognizableBuildImageConfiguration
, Fabric8 Maven Plugin repeatedly calls the s2i image generators to create another defaultImageConfiguration
that contains the expectedBuildImageConfiguration
. This results in more than oneImageConfiguration
being specified for the given s2i build, which in turn results in aDuplicateKeyException
when FMP attempts to push the image to the registry specified in thepom.xml
configuration 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. - Workaround
To prevent Fabric8 Maven Plugin form generating a duplicate
ImageConfiguration
, place the image configuration inside abuild
section in thepom.xml
configuration file of your project, as shown in the examples below. This in turn prevents theDuplicateKeyException
when 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>