DockerComposeConverter currently interprets a docker-compose version 3 file as version 1.
Expected Behaviour
I expect it would read the file, even if all version 3 features weren't support.
Current Behaviour
Throws an exception:
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
at org.arquillian.cube.docker.impl.util.YamlUtil.asMap(YamlUtil.java:32)
at org.arquillian.cube.docker.impl.docker.compose.DockerComposeConverter.convert(DockerComposeConverter.java:73)
Steps To Reproduce
Provide a version 3 docker-compose.yml file.
Additional Information
org.arquillian.cube.docker.impl.docker.compose.DockerComposeConverter, line 68:
Issue Overview
DockerComposeConverter currently interprets a docker-compose version 3 file as version 1.
Expected Behaviour
I expect it would read the file, even if all version 3 features weren't support.
Current Behaviour
Throws an exception:
Steps To Reproduce
Provide a version 3 docker-compose.yml file.
Additional Information
org.arquillian.cube.docker.impl.docker.compose.DockerComposeConverter, line 68:
boolean isV2 = names.contains(DOCKER_COMPOSE_VERSION_KEY) && DOCKER_COMPOSE_VERSION_2_VALUE.equals(dockerComposeDefinitionMap.get(DOCKER_COMPOSE_VERSION_KEY));
could do with parsing the version property as a number and comparing:
boolean isV2 = names.contains(DOCKER_COMPOSE_VERSION_KEY) && Integer.parseInt(dockerComposeDefinitionMap.get(DOCKER_COMPOSE_VERSION_KEY)) >= 2;