From e6631c5815980aa2dbb27c776885920380cfbab3 Mon Sep 17 00:00:00 2001 From: Pawel Wieczorek Date: Thu, 13 Aug 2020 11:23:22 +0200 Subject: Add support for detecting Java 8 For Java 11 there are four ways of checking Java binary version: * -version print product version to the error stream and exit * -showversion print product version to the error stream and continue * --version print product version to the output stream and exit * --show-version print product version to the output stream and continue For Java 8 only error stream options are available. There is no support for output stream (double-hyphenated) options. This patch extends list of executed commands for binary version detection. Java 8 presence will now be shown in results instead of being reported as an error. Issue-ID: INT-1601 Change-Id: I1b538bc1f0826f6000fedb08860d12c15fe2fc14 Signed-off-by: Pawel Wieczorek --- test/security/check_versions/src/k8s_bin_versions_inspector.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test/security/check_versions/src') diff --git a/test/security/check_versions/src/k8s_bin_versions_inspector.py b/test/security/check_versions/src/k8s_bin_versions_inspector.py index bda7322f5..e5a59b923 100644 --- a/test/security/check_versions/src/k8s_bin_versions_inspector.py +++ b/test/security/check_versions/src/k8s_bin_versions_inspector.py @@ -381,10 +381,12 @@ def determine_versions_abstraction( """ commands = ([binary, "--version"] for binary in binaries) + commands_old = ([binary, "-version"] for binary in binaries) + commands_all = itertools.chain(commands, commands_old) # TODO: This list comprehension should be parallelized results = ( - sync_post_namespaced_pod_exec(api, container, command) for command in commands + sync_post_namespaced_pod_exec(api, container, command) for command in commands_all ) successes = ( @@ -439,7 +441,7 @@ def determine_versions_of_java( List of installed OpenJDK versions. """ - extractor = re.compile("openjdk ([0-9.]+)") + extractor = re.compile("openjdk [version\" ]*([0-9._]+)") binaries = generate_java_binaries() -- cgit 1.2.3-korg