Restrict build info loading to ES jar, not any jar#24049
Restrict build info loading to ES jar, not any jar#24049rjernst merged 4 commits intoelastic:masterfrom
Conversation
This change makes the build info initialization only try to load a jar manifest if it is the elasticsearch jar. Anything else (eg a repackaged ES for use of transport client in an uber jar) will contain "Unknown" for the build info as it does for tests currently.
jasontedor
left a comment
There was a problem hiding this comment.
The change looks good to me and I think we should get it in as soon as we can, but I would like to manually verify that this addresses the issues for deploying to an application container before this integrated and I opened #24050 so that having to do this manually is a one-time thing.
|
So manual testing shows that we'll need a little more here. We can discuss tomorrow. |
| final URL url = getElasticsearchCodebase(); | ||
| if (url.toString().endsWith(".jar")) { | ||
| final String urlStr = url.toString(); | ||
| if (urlStr.startsWith("file://") && (urlStr.endsWith(esPrefix + ".jar") || urlStr.endsWith(esPrefix + "-SNAPSHOT.jar"))) { |
There was a problem hiding this comment.
This isn't quite right. Wrap the ends with checks in parentheses.
There was a problem hiding this comment.
So it's starts with and (ends with or ends with).
There was a problem hiding this comment.
Also I think it is one slash only, annoyingly.
There was a problem hiding this comment.
Oh, I misread it (mobile phone, sorry). The only thing that needs to change then is file:// -> file:/.
|
I've tested this change by deploying a war that uses the |
This change makes the build info initialization only try to load a jar manifest if it is the elasticsearch jar. Anything else (eg a repackaged ES for use of transport client in an uber jar) will contain "Unknown" for the build info as it does for tests currently. fixes #21955
This change makes the build info initialization only try to load a jar manifest if it is the elasticsearch jar. Anything else (eg a repackaged ES for use of transport client in an uber jar) will contain "Unknown" for the build info as it does for tests currently. fixes #21955
This change makes the build info initialization only try to load a jar manifest if it is the elasticsearch jar. Anything else (eg a repackaged ES for use of transport client in an uber jar) will contain "Unknown" for the build info as it does for tests currently. fixes #21955
* master: (41 commits) Remove awaits fix from evil JNA native tests Correct handling of default and array settings Build: Switch jna dependency to an elastic version (elastic#24081) fix CategoryContextMappingTests compilation bugs testConcurrentGetAndSetOnPrimary - fix a race condition between indexing and updating value map Allow different data types for category in Context suggester (elastic#23491) Restrict build info loading to ES jar, not any jar (elastic#24049) Remove more hidden file leniency from plugins Register error listener in evil logger tests Detect using logging before configuration [DOCS] Added note about Elastic Cloud to improve 'elastic aws' SERP results. Add version constant for 5.5 (elastic#24075) Add unit tests for NestedAggregator (elastic#24054) Add more debugging information to rethrottles Tests: Use random analyzer only on string fields in Match/MultiMatchBuilderTests Cleanup outdated comments for fixing up pom dependencies (elastic#24056) S3 Repository: Eagerly load static settings (elastic#23910) Reject duplicate settings on the command line Wildcard cluster names for cross cluster search (elastic#23985) Update scripts/security docs for sandboxed world (elastic#23977) ...
This change makes the build info initialization only try to load a jar
manifest if it is the elasticsearch jar. Anything else (eg a repackaged
ES for use of transport client in an uber jar) will contain "Unknown"
for the build info as it does for tests currently.
fixes #21955