From d5de2f7044598fa47c362b4a065582df0d1e06b6 Mon Sep 17 00:00:00 2001 From: Steffen Ritter Date: Fri, 12 May 2023 18:13:45 +0200 Subject: Fix 'content is not allowed in prolog' Switch order of probing the virtualizerconfigs to bypass xml parsing of docker configs which are tgz-archives. We have no good handling of the different config types. VBox and Qemu are xml, vmware is plaintext, docker wraps everything in tgz. Instead of checking we actually just try and hope for the best :(. fixes: #3932 --- .../configuration/VirtualizationConfiguration.java | 10 +++++----- .../configuration/VirtualizationConfigurationDocker.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfiguration.java b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfiguration.java index d3b0191..c1895bf 100644 --- a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfiguration.java +++ b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfiguration.java @@ -248,6 +248,11 @@ public abstract class VirtualizationConfiguration } catch ( VirtualizationConfigurationException e ) { LOGGER.debug( "Not a VMware file", e ); } + try { + return new VirtualizationConfigurationDocker( osList, vmContent, length ); + } catch ( VirtualizationConfigurationException e ) { + LOGGER.debug( "Not a tar.gz file, for docker container", e ); + } try { return new VirtualizationConfigurationVirtualBox( osList, vmContent, length ); } catch ( VirtualizationConfigurationException e ) { @@ -258,11 +263,6 @@ public abstract class VirtualizationConfiguration } catch ( VirtualizationConfigurationException e ) { LOGGER.debug( "Not a Libvirt file", e ); } - try { - return new VirtualizationConfigurationDocker( osList, vmContent, length ); - } catch ( VirtualizationConfigurationException e ) { - LOGGER.debug( "Not a tar.gz file, for docker container", e ); - } throw new VirtualizationConfigurationException( "Unknown virtualizer config format" ); } diff --git a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationDocker.java b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationDocker.java index 9dfa0a6..8a06b80 100644 --- a/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationDocker.java +++ b/src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationDocker.java @@ -75,7 +75,7 @@ public class VirtualizationConfigurationDocker extends VirtualizationConfigurati */ private void checkIsTarGz() throws VirtualizationConfigurationException { if (!((31 == containerDefinition[0]) && (-117 == containerDefinition[1]))) { - LOGGER.warn("Not Supported Content."); + LOGGER.debug("Not Supported Content."); throw new VirtualizationConfigurationException( "DockerMetaDataDummy: Not tar.gz encoded content!"); } -- cgit v1.2.3-55-g7522