-
Notifications
You must be signed in to change notification settings - Fork 530
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
fix (jkube-kit-spring-boot) : Directly read layers.idx
file to get layers information
#3236
Conversation
Eclipse JKube CI ReportStarted new GH workflow run for #3236 (2024-07-18T14:34:13Z) ⚙️ JKube E2E Tests (9992665491)
|
layers.idx
file to get layers information
4096a5c
to
0ffa906
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK, but are there any tests to verify this?
It seems like the prior mechanism didn't have tests either
String layerFileContent = IOUtils.toString(jarFile.getInputStream(jarFile.getEntry("BOOT-INF/layers.idx")), StandardCharsets.UTF_8); | ||
List<Map<String, List<String>>> layers = Serialization.unmarshal(layerFileContent, List.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why aren't we using Serialization.unmarshal from InputSream?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, okay. let me use that method.
We have SpringBootLayeredJarTest that verifies layer list with real jar and fake jar (created within test) Line 91 in 9fb1085
Line 114 in 9fb1085
|
…yers information Till now we were executing layertools list command to extract layer related information for Spring Boot Layered jar. This has started causing problems in Spring Boot 3.3.x where we're getting additional deprecation warning that's breaking behavior of SpringBootGenerator. Additionally, layertools command has become deprecated in Spring Boot 3.3.x Instead of relying on layertools command, directly read layers.idx file present in layered jar to extract list of layers. Signed-off-by: Rohan Kumar <rohaan@redhat.com>
0ffa906
to
474683e
Compare
OK, that's cool. It means that regardless of the underlying implementation, the black-boxed test is working as expected 🎉 |
Yes, on top of that we also have CompleteOcDockerLayersDisabledITCase to verify that plugin works with or without layer functionality |
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thx!
Description
Fix #3228
Till now we were executing layertools list command to extract layer related information for Spring Boot Layered jar. This has started causing problems in Spring Boot 3.3.x where we're getting additional deprecation warning that's breaking behavior of SpringBootGenerator. Additionally, layertools command has become deprecated in Spring Boot 3.3.x
Instead of relying on layertools command, directly read layers.idx file present in layered jar to extract list of layers.
layers.idx
file format seems to be consistent across previous Spring Boot versions. You can see it's spec in LayersIndex.java :Existing tests verify that the SpringBootLayeredJar works as expected even after making this change.
Type of change
test, version modification, documentation, etc.)
Checklist