Skip to content
This repository was archived by the owner on Jun 16, 2021. It is now read-only.
This repository was 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

Description

@prashanthjbabu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions