Skip to content

Commit 1ee44a0

Browse files
authored
config: use correct YAML marshal func (docker#9712)
The `compose-spec/compose-go` lib is written with `gopkg.in/yaml.v2` as a target. When marshalling via CLI (`compose convert` / `compose config`), we were using a _different_ YAML lib, which was a fork of `go-yaml`, which is what `gopkg.in/yaml.v2` is based off of. Signed-off-by: Milas Bowman <[email protected]>
1 parent 8d4846f commit 1ee44a0

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ require (
2727
github.com/opencontainers/go-digest v1.0.0
2828
github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799
2929
github.com/pkg/errors v0.9.1
30-
github.com/sanathkr/go-yaml v0.0.0-20170819195128-ed9d249f429b
3130
github.com/sirupsen/logrus v1.9.0
3231
github.com/spf13/cobra v1.5.0
3332
github.com/spf13/pflag v1.0.5
3433
github.com/stretchr/testify v1.8.0
3534
github.com/theupdateframework/notary v0.7.0
3635
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
36+
gopkg.in/yaml.v2 v2.4.0
3737
gotest.tools v2.2.0+incompatible
3838
gotest.tools/v3 v3.3.0
3939
)
@@ -120,7 +120,6 @@ require (
120120
google.golang.org/grpc v1.45.0 // indirect
121121
google.golang.org/protobuf v1.27.1 // indirect
122122
gopkg.in/inf.v0 v0.9.1 // indirect
123-
gopkg.in/yaml.v2 v2.4.0 // indirect
124123
gopkg.in/yaml.v3 v3.0.1 // indirect
125124
k8s.io/apimachinery v0.24.1 // indirect; see replace for the actual version used
126125
k8s.io/client-go v0.24.1 // indirect; see replace for the actual version used

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,8 +1222,6 @@ github.com/ryancurrah/gomodguard v1.1.0/go.mod h1:4O8tr7hBODaGE6VIhfJDHcwzh5GUcc
12221222
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
12231223
github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4=
12241224
github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4=
1225-
github.com/sanathkr/go-yaml v0.0.0-20170819195128-ed9d249f429b h1:jUK33OXuZP/l6babJtnLo1qsGvq6G9so9KMflGAm4YA=
1226-
github.com/sanathkr/go-yaml v0.0.0-20170819195128-ed9d249f429b/go.mod h1:8458kAagoME2+LN5//WxE71ysZ3B7r22fdgb7qVmXSY=
12271225
github.com/sassoftware/go-rpmutils v0.0.0-20190420191620-a8f1baeba37b/go.mod h1:am+Fp8Bt506lA3Rk3QCmSqmYmLMnPDhdDUcosQCAx+I=
12281226
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
12291227
github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw=

pkg/compose/compose.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import (
2424
"io"
2525
"strings"
2626

27+
"gopkg.in/yaml.v2"
28+
2729
"github.com/compose-spec/compose-go/types"
2830
"github.com/docker/cli/cli/command"
2931
"github.com/docker/cli/cli/config/configfile"
@@ -33,7 +35,6 @@ import (
3335
"github.com/docker/docker/api/types/filters"
3436
"github.com/docker/docker/client"
3537
"github.com/pkg/errors"
36-
"github.com/sanathkr/go-yaml"
3738
)
3839

3940
// NewComposeService create a local implementation of the compose.Service API

0 commit comments

Comments
 (0)