-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Springboot 3.3.1 breaks jkube openshift plugin #3228
Comments
@Farzad407 : Based on your findings, I see this line is causing the issue (we're adding any output as a layer) . I think we should apply some kind of filtering here to only add in case there is only one word in the line. Or maybe add some flag to layertools command to not add any additional output apart from layer names. Lines 110 to 113 in 3db16fd
|
that was my first inclination but then I realized that layertools prints out other informational lines such the line about the logger in the path and the line about the new syntax. All those lines are not empty and are being added as a layer in the assembly. I am not sure if those layers will cause any issues in the image. I think one possibility is to read and parse the layers.idx file but I have not done the research to see if there are any issues with that. One other possibility is to test if the layer actually exists in the jar. |
Looking at IndexLayers.java this is parsed as - "dependencies":
- "BOOT-INF/lib/"
- "spring-boot-loader":
- "org/"
- "snapshot-dependencies":
- "application":
- "BOOT-INF/classes/"
- "BOOT-INF/classpath.idx"
- "BOOT-INF/layers.idx"
- "META-INF/" |
I think you're right. Reading |
I have checked the format of layers.idx file in Spring Boot 2.5.6, 3.0.11, 3.1.5, 3.2.7, 3.3.1 . It's format is the same. The javadoc defines it like this:
|
@rohanKanojia thanks for the quick turn around on this. when do you think the fix will be released? |
@Farzad407 Could you please check if you can resolve issue by using You can check how to use JKube Snapshot artifacts here |
@rohanKanojia Yes I just tested |
Describe the bug
springboot 3.3.1 comes with a new layertool that breaks jkube openshift plugin. Projects upgrading to springboot 3.3.1 will get the following error when they run oc:build command:
[ERROR] Failed to execute goal org.eclipse.jkube:openshift-maven-plugin:1.16.2:build (default-cli) on project layered-jar-3.3.1-bug: Failed to execute the build: Unable to build the image using the OpenShift build service: Assemblies with more than one layer require a proper id for each layer -> [Help 1]
The core of the issue is the new layertool is that there is an extra message accompanied by a new line in the output when command
java -Djarmode=layertools -jar xxx.jar list
is runJkube identifies the empty line as an individual layer without an id and fails with error message provided above. Additionally, JKube identifies any line output in the layertool as a layer. In our case, layer tool has additional lines in the output that are picked as layers erroneously. Here is a sample layertool output on our project:
in the above case, JKube creates the following 8 layers where as only layer 4-7 are applicable.
Eclipse JKube version
1.16.2
Component
OpenShift Maven Plugin
Apache Maven version
other (please specify in additional context)
Gradle version
None
Steps to reproduce
run
mvn package oc:build
on the project in https://github.com/Farzad407/layered-jar-3.3.1-bug repository.Expected behavior
image build task to succeed.
Runtime
OpenShift
Kubernetes API Server version
1.25.3
Environment
macOS
Eclipse JKube Logs
Sample Reproducer Project
https://github.com/Farzad407/layered-jar-3.3.1-bug
Additional context
maven version 3.9.6 but it should be reproducible across all maven versions.
The text was updated successfully, but these errors were encountered: