Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

libcompose differentiating between version 2 and version 2.0 #514

Open
prashanthjbabu opened this issue Sep 18, 2018 · 0 comments
Open

libcompose differentiating between version 2 and version 2.0 #514

prashanthjbabu opened this issue Sep 18, 2018 · 0 comments

Comments

@prashanthjbabu
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant