libcompose icon indicating copy to clipboard operation
libcompose copied to clipboard

libcompose differentiating between version 2 and version 2.0

Open prashanthjbabu opened this issue 7 years ago • 0 comments

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.

prashanthjbabu avatar Sep 18 '18 04:09 prashanthjbabu