Skip to content

Commit 9cab6c9

Browse files
authored
chore: Replace ghodss/yaml with sigs.k8s.io/yaml (#6195)
This is a fork that is maintained by the kubernetes community. https://github.com/kubernetes-sigs/yaml Signed-off-by: Manuel Rüger <[email protected]>
1 parent c28eaf7 commit 9cab6c9

25 files changed

+260
-44
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ require (
1212
github.com/fortytw2/leaktest v1.3.0
1313
github.com/foxcpp/go-mockdns v1.0.0
1414
github.com/fsnotify/fsnotify v1.6.0
15-
github.com/ghodss/yaml v1.0.0
1615
github.com/go-ini/ini v1.67.0
1716
github.com/go-logr/logr v1.2.4
1817
github.com/gobwas/glob v0.2.3
@@ -44,6 +43,7 @@ require (
4443
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
4544
gopkg.in/yaml.v2 v2.4.0
4645
oras.land/oras-go/v2 v2.2.1
46+
sigs.k8s.io/yaml v1.3.0
4747
)
4848

4949
require (

go.sum

+2-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ github.com/foxcpp/go-mockdns v1.0.0/go.mod h1:lgRN6+KxQBawyIghpnl5CezHFGS9VLzvtV
112112
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
113113
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
114114
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
115-
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
116115
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
117116
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
118117
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
@@ -646,3 +645,5 @@ oras.land/oras-go/v2 v2.2.1/go.mod h1:GeAwLuC4G/JpNwkd+bSZ6SkDMGaaYglt6YK2WvZP7u
646645
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
647646
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
648647
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
648+
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
649+
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=

internal/config/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"regexp"
1313
"strings"
1414

15-
"github.com/ghodss/yaml"
15+
"sigs.k8s.io/yaml"
1616

1717
"github.com/open-policy-agent/opa/internal/strvals"
1818
"github.com/open-policy-agent/opa/keys"

internal/config/config_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"reflect"
1313
"testing"
1414

15-
"github.com/ghodss/yaml"
15+
"sigs.k8s.io/yaml"
1616

1717
"github.com/open-policy-agent/opa/util/test"
1818
)

internal/strvals/parser.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"strconv"
2424
"strings"
2525

26-
"github.com/ghodss/yaml"
26+
"sigs.k8s.io/yaml"
2727
)
2828

2929
// ErrNotList indicates that a non-list was treated as a list.

internal/strvals/parser_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package strvals
1818
import (
1919
"testing"
2020

21-
"github.com/ghodss/yaml"
21+
"sigs.k8s.io/yaml"
2222
)
2323

2424
func TestSetIndex(t *testing.T) {

loader/loader.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"sort"
1616
"strings"
1717

18-
"github.com/ghodss/yaml"
18+
"sigs.k8s.io/yaml"
1919

2020
"github.com/open-policy-agent/opa/ast"
2121
"github.com/open-policy-agent/opa/bundle"

plugins/bundle/config_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
"github.com/open-policy-agent/opa/bundle"
1616

17-
"github.com/ghodss/yaml"
17+
"sigs.k8s.io/yaml"
1818
)
1919

2020
func TestConfigValidation(t *testing.T) {

topdown/encoding.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"net/url"
1414
"strings"
1515

16-
ghodss "github.com/ghodss/yaml"
16+
"sigs.k8s.io/yaml"
1717

1818
"github.com/open-policy-agent/opa/ast"
1919
"github.com/open-policy-agent/opa/topdown/builtins"
@@ -232,7 +232,7 @@ func builtinYAMLMarshal(_ BuiltinContext, operands []*ast.Term, iter func(*ast.T
232232
return err
233233
}
234234

235-
bs, err := ghodss.JSONToYAML(buf.Bytes())
235+
bs, err := yaml.JSONToYAML(buf.Bytes())
236236
if err != nil {
237237
return err
238238
}
@@ -247,7 +247,7 @@ func builtinYAMLUnmarshal(_ BuiltinContext, operands []*ast.Term, iter func(*ast
247247
return err
248248
}
249249

250-
bs, err := ghodss.YAMLToJSON([]byte(str))
250+
bs, err := yaml.YAMLToJSON([]byte(str))
251251
if err != nil {
252252
return err
253253
}
@@ -273,7 +273,7 @@ func builtinYAMLIsValid(_ BuiltinContext, operands []*ast.Term, iter func(*ast.T
273273
}
274274

275275
var x interface{}
276-
err = ghodss.Unmarshal([]byte(str), &x)
276+
err = yaml.Unmarshal([]byte(str), &x)
277277
return iter(ast.BooleanTerm(err == nil))
278278
}
279279

topdown/topdown_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ import (
2121
"time"
2222

2323
"github.com/open-policy-agent/opa/format"
24-
25-
"github.com/ghodss/yaml"
24+
"sigs.k8s.io/yaml"
2625

2726
iCache "github.com/open-policy-agent/opa/topdown/cache"
2827

util/json.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"io"
1212
"reflect"
1313

14-
"github.com/ghodss/yaml"
14+
"sigs.k8s.io/yaml"
1515

1616
"github.com/open-policy-agent/opa/loader/extension"
1717
)

vendor/github.com/ghodss/yaml/.travis.yml

-7
This file was deleted.

vendor/modules.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ github.com/foxcpp/go-mockdns
9191
# github.com/fsnotify/fsnotify v1.6.0
9292
## explicit; go 1.16
9393
github.com/fsnotify/fsnotify
94-
# github.com/ghodss/yaml v1.0.0
95-
## explicit
96-
github.com/ghodss/yaml
9794
# github.com/go-ini/ini v1.67.0
9895
## explicit
9996
github.com/go-ini/ini
@@ -487,4 +484,7 @@ oras.land/oras-go/v2/registry/remote/auth
487484
oras.land/oras-go/v2/registry/remote/errcode
488485
oras.land/oras-go/v2/registry/remote/internal/errutil
489486
oras.land/oras-go/v2/registry/remote/retry
487+
# sigs.k8s.io/yaml v1.3.0
488+
## explicit; go 1.12
489+
sigs.k8s.io/yaml
490490
# github.com/golang/glog => ./build/replacements/github.com/golang/glog

vendor/github.com/ghodss/yaml/.gitignore vendor/sigs.k8s.io/yaml/.gitignore

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/sigs.k8s.io/yaml/.travis.yml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/sigs.k8s.io/yaml/CONTRIBUTING.md

+31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/sigs.k8s.io/yaml/OWNERS

+27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/ghodss/yaml/README.md vendor/sigs.k8s.io/yaml/README.md

+9-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/sigs.k8s.io/yaml/RELEASE.md

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/sigs.k8s.io/yaml/SECURITY_CONTACTS

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/sigs.k8s.io/yaml/code-of-conduct.md

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/ghodss/yaml/fields.go vendor/sigs.k8s.io/yaml/fields.go

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)