docker / libcompose

*Unmaintained/Deprecated* An experimental go library providing Compose-like functionality
https://godoc.org/github.com/docker/libcompose
Apache License 2.0
585 stars 191 forks source link

compose version: "2.0" #490

Closed abuckenheimer closed 5 years ago

abuckenheimer commented 6 years ago

Hey folks,

Noticed an issue using a downstream project ecs-cli where libcompose fails to parse the compose file when version is set to "2.0" instead of "2". I have never been a gopher but if I had to take a stab at it it seems like the issue is a naive string comparison here: if config.Version != "2" { ... when really one would want to check for "2" or "2.0"?

A good test might be ./libcompose-cli config | ./libcompose-cli -f - config using any docker-compose.yml. This is essentially how I ran into the bug in the wild and is a convenient way to assert that libcompose-cli config only outputs valid compose files and can read all valid compose files.

Thanks in advance! Sorry I can't be any more help :sad:

CpuID commented 5 years ago

This can be closed thanks to https://github.com/docker/libcompose/pull/507 for now I think (lack of test coverage, but the bug is resolved).