summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Ritter2023-05-12 18:13:45 +0200
committerSteffen Ritter2023-05-12 18:13:45 +0200
commitd5de2f7044598fa47c362b4a065582df0d1e06b6 (patch)
tree2b4efad4d092e2f49b75dbb739118bf74fc2f4bc
parentActually really properly fix test and handle UUID changes again (diff)
downloadmaster-sync-shared-d5de2f7044598fa47c362b4a065582df0d1e06b6.tar.gz
master-sync-shared-d5de2f7044598fa47c362b4a065582df0d1e06b6.tar.xz
master-sync-shared-d5de2f7044598fa47c362b4a065582df0d1e06b6.zip
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
-rw-r--r--src/main/java/org/openslx/virtualization/configuration/VirtualizationConfiguration.java10
-rw-r--r--src/main/java/org/openslx/virtualization/configuration/VirtualizationConfigurationDocker.java2
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
@@ -249,6 +249,11 @@ public abstract class VirtualizationConfiguration
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 ) {
LOGGER.debug( "Not a VirtualBox file", 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!");
}