mirror of
https://github.com/containers/podman.git
synced 2025-06-24 03:08:13 +08:00
use gopkg.in/yaml.v2 instead of v3
Many dependencies already import gopkg.in/yaml.v2, podman is the only user of the v3 version except github.com/stretchr/testify but this is only a testing dependency so it will not end up in the binary. This change reduces the podman binary size from 54740 to 54260 KB on my system. [NO NEW TESTS NEEDED] Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
2
go.mod
2
go.mod
@ -69,7 +69,7 @@ require (
|
||||
golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27
|
||||
golang.org/x/text v0.3.7
|
||||
google.golang.org/protobuf v1.27.1
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
k8s.io/api v0.22.5
|
||||
k8s.io/apimachinery v0.22.5
|
||||
)
|
||||
|
@ -28,7 +28,7 @@ import (
|
||||
"github.com/ghodss/yaml"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
yamlv3 "gopkg.in/yaml.v3"
|
||||
yamlv2 "gopkg.in/yaml.v2"
|
||||
v1apps "k8s.io/api/apps/v1"
|
||||
v1 "k8s.io/api/core/v1"
|
||||
)
|
||||
@ -655,7 +655,7 @@ func readConfigMapFromFile(r io.Reader) (v1.ConfigMap, error) {
|
||||
func splitMultiDocYAML(yamlContent []byte) ([][]byte, error) {
|
||||
var documentList [][]byte
|
||||
|
||||
d := yamlv3.NewDecoder(bytes.NewReader(yamlContent))
|
||||
d := yamlv2.NewDecoder(bytes.NewReader(yamlContent))
|
||||
for {
|
||||
var o interface{}
|
||||
// read individual document
|
||||
@ -669,7 +669,7 @@ func splitMultiDocYAML(yamlContent []byte) ([][]byte, error) {
|
||||
|
||||
if o != nil {
|
||||
// back to bytes
|
||||
document, err := yamlv3.Marshal(o)
|
||||
document, err := yamlv2.Marshal(o)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "individual doc yaml could not be marshalled")
|
||||
}
|
||||
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@ -881,9 +881,9 @@ gopkg.in/square/go-jose.v2/json
|
||||
# gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
|
||||
gopkg.in/tomb.v1
|
||||
# gopkg.in/yaml.v2 v2.4.0
|
||||
## explicit
|
||||
gopkg.in/yaml.v2
|
||||
# gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
|
||||
## explicit
|
||||
gopkg.in/yaml.v3
|
||||
# k8s.io/api v0.22.5
|
||||
## explicit
|
||||
|
Reference in New Issue
Block a user