Add support for compose 2.x (#1333)

This commit is contained in:
Hang Yan 2020-10-31 08:27:50 +08:00 committed by GitHub
parent fd3e79e990
commit f31257f5cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

4
go.mod
View File

@ -4,7 +4,7 @@ go 1.13
replace github.com/Sirupsen/logrus => github.com/sirupsen/logrus v1.6.0
replace github.com/docker/libcompose => github.com/docker/libcompose v0.4.1-0.20171025083809-57bd716502dc
replace github.com/docker/libcompose => github.com/docker/libcompose v0.4.1-0.20180821054414-cfb957a49ca6
replace github.com/docker/cli => github.com/docker/cli v0.0.0-20180529093712-df6e38b81a94
@ -16,7 +16,7 @@ replace golang.org/x/sys => golang.org/x/sys v0.0.0-20190830141801-acfa387b8d69
require (
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
github.com/docker/cli v0.0.0-00010101000000-000000000000
github.com/docker/cli v0.0.0-20190711175710-5b38d82aa076
github.com/docker/libcompose v0.4.0
github.com/fatih/structs v1.1.0
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect

4
go.sum
View File

@ -76,8 +76,8 @@ github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKoh
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/docker/libcompose v0.4.1-0.20171025083809-57bd716502dc h1:N92ATQRpctiOJCFodOWiyo8fbU/3xghg/FbGjSkoATw=
github.com/docker/libcompose v0.4.1-0.20171025083809-57bd716502dc/go.mod h1:EyqDS+Iyca0hS44T7qIMTeO1EOYWWWNOGpufHu9R8cs=
github.com/docker/libcompose v0.4.1-0.20180821054414-cfb957a49ca6 h1:8q4/3loJJTebnUCPj8v7fJxuzOSB7HXtuz+KMg8EV8I=
github.com/docker/libcompose v0.4.1-0.20180821054414-cfb957a49ca6/go.mod h1:EyqDS+Iyca0hS44T7qIMTeO1EOYWWWNOGpufHu9R8cs=
github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=

View File

@ -169,7 +169,7 @@ func (c *Compose) LoadFile(files []string) (kobject.KomposeObject, error) {
switch version {
// Use libcompose for 1 or 2
// If blank, it's assumed it's 1 or 2
case "", "1", "1.0", "2", "2.0":
case "", "1", "1.0", "2", "2.0", "2.1", "2.2":
komposeObject, err := parseV1V2(files)
if err != nil {
return kobject.KomposeObject{}, err