Skip to content

Commit

Permalink
chore: Replace ghodss/yaml with sigs.k8s.io/yaml
Browse files Browse the repository at this point in the history
This is a fork that is maintained by the kubernetes community.

https://github.com/kubernetes-sigs/yaml
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
  • Loading branch information
mrueg committed Aug 29, 2023
1 parent 519eea7 commit 3eaec5e
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
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

0 comments on commit 3eaec5e

Please sign in to comment.