Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Replace ghodss/yaml with sigs.k8s.io/yaml #6195

Merged
merged 2 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ require (
github.com/fortytw2/leaktest v1.3.0
github.com/foxcpp/go-mockdns v1.0.0
github.com/fsnotify/fsnotify v1.6.0
github.com/ghodss/yaml v1.0.0
github.com/go-ini/ini v1.67.0
github.com/go-logr/logr v1.2.4
github.com/gobwas/glob v0.2.3
Expand Down Expand Up @@ -44,6 +43,7 @@ require (
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
gopkg.in/yaml.v2 v2.4.0
oras.land/oras-go/v2 v2.2.1
sigs.k8s.io/yaml v1.3.0
)

require (
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ github.com/foxcpp/go-mockdns v1.0.0/go.mod h1:lgRN6+KxQBawyIghpnl5CezHFGS9VLzvtV
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
Expand Down Expand Up @@ -646,3 +645,5 @@ oras.land/oras-go/v2 v2.2.1/go.mod h1:GeAwLuC4G/JpNwkd+bSZ6SkDMGaaYglt6YK2WvZP7u
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"regexp"
"strings"

"github.com/ghodss/yaml"
"sigs.k8s.io/yaml"

"github.com/open-policy-agent/opa/internal/strvals"
"github.com/open-policy-agent/opa/keys"
Expand Down
2 changes: 1 addition & 1 deletion internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"reflect"
"testing"

"github.com/ghodss/yaml"
"sigs.k8s.io/yaml"

"github.com/open-policy-agent/opa/util/test"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/strvals/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"strconv"
"strings"

"github.com/ghodss/yaml"
"sigs.k8s.io/yaml"
)

// ErrNotList indicates that a non-list was treated as a list.
Expand Down
2 changes: 1 addition & 1 deletion internal/strvals/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package strvals
import (
"testing"

"github.com/ghodss/yaml"
"sigs.k8s.io/yaml"
)

func TestSetIndex(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"sort"
"strings"

"github.com/ghodss/yaml"
"sigs.k8s.io/yaml"

"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/bundle"
Expand Down
2 changes: 1 addition & 1 deletion plugins/bundle/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

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

"github.com/ghodss/yaml"
"sigs.k8s.io/yaml"
)

func TestConfigValidation(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions topdown/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"net/url"
"strings"

ghodss "github.com/ghodss/yaml"
"sigs.k8s.io/yaml"

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

bs, err := ghodss.JSONToYAML(buf.Bytes())
bs, err := yaml.JSONToYAML(buf.Bytes())
if err != nil {
return err
}
Expand All @@ -247,7 +247,7 @@ func builtinYAMLUnmarshal(_ BuiltinContext, operands []*ast.Term, iter func(*ast
return err
}

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

var x interface{}
err = ghodss.Unmarshal([]byte(str), &x)
err = yaml.Unmarshal([]byte(str), &x)
return iter(ast.BooleanTerm(err == nil))
}

Expand Down
3 changes: 1 addition & 2 deletions topdown/topdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import (
"time"

"github.com/open-policy-agent/opa/format"

"github.com/ghodss/yaml"
"sigs.k8s.io/yaml"

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

Expand Down
2 changes: 1 addition & 1 deletion util/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"io"
"reflect"

"github.com/ghodss/yaml"
"sigs.k8s.io/yaml"

"github.com/open-policy-agent/opa/loader/extension"
)
Expand Down
7 changes: 0 additions & 7 deletions vendor/github.com/ghodss/yaml/.travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ github.com/foxcpp/go-mockdns
# github.com/fsnotify/fsnotify v1.6.0
## explicit; go 1.16
github.com/fsnotify/fsnotify
# github.com/ghodss/yaml v1.0.0
## explicit
github.com/ghodss/yaml
# github.com/go-ini/ini v1.67.0
## explicit
github.com/go-ini/ini
Expand Down Expand Up @@ -487,4 +484,7 @@ oras.land/oras-go/v2/registry/remote/auth
oras.land/oras-go/v2/registry/remote/errcode
oras.land/oras-go/v2/registry/remote/internal/errutil
oras.land/oras-go/v2/registry/remote/retry
# sigs.k8s.io/yaml v1.3.0
## explicit; go 1.12
sigs.k8s.io/yaml
# github.com/golang/glog => ./build/replacements/github.com/golang/glog

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions vendor/sigs.k8s.io/yaml/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions vendor/sigs.k8s.io/yaml/CONTRIBUTING.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
27 changes: 27 additions & 0 deletions vendor/sigs.k8s.io/yaml/OWNERS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions vendor/sigs.k8s.io/yaml/RELEASE.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions vendor/sigs.k8s.io/yaml/SECURITY_CONTACTS

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions vendor/sigs.k8s.io/yaml/code-of-conduct.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading