libcompose differentiating between version 2 and version 2.0 #514
Description
According to documentation https://docs.docker.com/compose/compose-file/compose-versioning/#version-2 . Version 2 and 2.0 are meant to be the same although libcompose seems to be treating them differently throwing out a different config whenever the API project.Config() is called.
Example :
1)
prash@prash-laptop:/tmp/testcompose$ cat test.yml
{"services":{"helloworld":{"container_name":"helloworld","image":"tutum/hello-world" }},"version":"2"}
prash@prash-laptop:/tmp/testcompose$ go run test.go
version: "2.0"
services:
helloworld:
container_name: helloworld
image: tutum/hello-world
networks:
default: {}
volumes: {}
networks:
default: {}
prash@prash-laptop:/tmp/testcompose$ cat test.yml
{"services":{"helloworld":{"container_name":"helloworld","image":"tutum/hello-world" }},"version":"2.0"}
prash@prash-laptop:/tmp/testcompose$ go run test.go
version: "2.0"
services:
helloworld:
container_name: helloworld
image: tutum/hello-world
volumes: {}
networks: {}
The outputs for example 1 and 2 are different even though the versions for case 1 and 2 are the same except that they were represented as 2 and 2.0 respectively.