summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorralph isenmann2020-08-19 10:13:31 +0200
committerralph isenmann2020-08-19 10:13:31 +0200
commit85da408a94f5e6c1b77a4d45f8462fd759705fff (patch)
tree76529738d47979debaed9615fc25629f2a05a5c2
parentadd dockerfile as byte array to DockerMetaDataDummy.java (diff)
downloadmaster-sync-shared-docker-integration.tar.gz
master-sync-shared-docker-integration.tar.xz
master-sync-shared-docker-integration.zip
Create Object of DockerMetaDataDummydocker-integration
VmMetaDate.getInstance of a DockerMetaDataDummy
-rw-r--r--src/main/java/org/openslx/util/vm/DockerMetaDataDummy.java4
-rw-r--r--src/main/java/org/openslx/util/vm/VmMetaData.java10
2 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/org/openslx/util/vm/DockerMetaDataDummy.java b/src/main/java/org/openslx/util/vm/DockerMetaDataDummy.java
index 473f1c0..3ee964f 100644
--- a/src/main/java/org/openslx/util/vm/DockerMetaDataDummy.java
+++ b/src/main/java/org/openslx/util/vm/DockerMetaDataDummy.java
@@ -14,6 +14,10 @@ public class DockerMetaDataDummy extends VmMetaData {
private final Virtualizer virtualizer = new Virtualizer( TConst.VIRT_DOCKER, "Docker" );
+ /* this field is in vm context the machine description
+ e.g. vmware = vmx.
+ This field will be stored in table imageversion.virtualizerconfig
+ */
private byte[] dockerfile;
public DockerMetaDataDummy(List osList, File file) {
diff --git a/src/main/java/org/openslx/util/vm/VmMetaData.java b/src/main/java/org/openslx/util/vm/VmMetaData.java
index 0d191e5..c836697 100644
--- a/src/main/java/org/openslx/util/vm/VmMetaData.java
+++ b/src/main/java/org/openslx/util/vm/VmMetaData.java
@@ -313,6 +313,8 @@ public abstract class VmMetaData<T, U, V, W, X>
LOGGER.info( "Not a QEmu file", e );
}
try {
+ // TODO This will work for each file because simple read as byte array
+ // TODO No checks if file is a dockerfile --- THIS SHOOULD NOT BE IN PRODUCTION
return new DockerMetaDataDummy(osList, file);
} catch ( Exception e ) {
LOGGER.info( "Not a docker file", e );
@@ -343,6 +345,14 @@ public abstract class VmMetaData<T, U, V, W, X>
} catch ( UnsupportedVirtualizerFormatException e ) {
exceptions.put( "Not a VirtualBox file", e );
}
+ try {
+ // TODO This should work in each case, because no checks if vmContent is dockerfile
+ // TODO --- THIS SHOULD NOT BE IN PRODUCTION
+ LOGGER.info("Creating DockerMetaDataDummy from vmContent");
+ return new DockerMetaDataDummy(osList, vmContent, length);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
// TODO QEmu -- hack above expects qcow2 file, so we can't do anything here yet
LOGGER.error( "Could not detect any known virtualizer format" );
for ( Entry<String, Exception> e : exceptions.entrySet() ) {