Skip to content

Commit

Permalink
chore: consolidate yaml lib usage
Browse files Browse the repository at this point in the history
  • Loading branch information
rriski committed Jan 22, 2025
1 parent 2dd5741 commit e904a16
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion generators/charts/changelog.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"strconv"
"strings"

"github.com/goccy/go-yaml"
"github.com/google/go-cmp/cmp"
"golang.org/x/exp/constraints"
"golang.org/x/exp/maps"
"golang.org/x/exp/slices"
"gopkg.in/yaml.v3"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion generators/charts/cluster_roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"path"

"gopkg.in/yaml.v3"
"github.com/goccy/go-yaml"
)

type clusterRoleYaml struct {
Expand Down
2 changes: 1 addition & 1 deletion generators/charts/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"os"

"gopkg.in/yaml.v3"
"github.com/goccy/go-yaml"
)

const compactIndent = 2
Expand Down
2 changes: 1 addition & 1 deletion generators/charts/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
"time"

"gopkg.in/yaml.v3"
"github.com/goccy/go-yaml"
)

type chartYaml struct {
Expand Down
2 changes: 1 addition & 1 deletion generators/docs/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"strings"
"text/template"

"github.com/goccy/go-yaml"
"golang.org/x/exp/slices"
"gopkg.in/yaml.v3"
)

const (
Expand Down
5 changes: 2 additions & 3 deletions generators/docs/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import (
"path/filepath"
"strings"

"github.com/goccy/go-yaml"
"github.com/xeipuuv/gojsonschema"
"gopkg.in/yaml.v3"
yaml2 "sigs.k8s.io/yaml"
)

// crdSchema schema
Expand Down Expand Up @@ -90,7 +89,7 @@ func newSchemaValidator(kind string, crd []byte) (schemaValidator, error) {

return func(document []byte) error {
// Validates given document
jsonDocument, err := yaml2.YAMLToJSON(document)
jsonDocument, err := yaml.YAMLToJSON(document)
if err != nil {
return fmt.Errorf("can't convert yaml to json: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion generators/userconfigs/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"strings"

"github.com/dave/jennifer/jen"
"github.com/goccy/go-yaml"
"github.com/google/go-cmp/cmp"
"github.com/stoewer/go-strcase"
"golang.org/x/exp/slices"
"golang.org/x/tools/imports"
"gopkg.in/yaml.v3"
)

// generate writes to file a service user config for a given serviceList
Expand Down
2 changes: 1 addition & 1 deletion generators/userconfigs/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"os"
"testing"

"github.com/goccy/go-yaml"
"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
)

func TestNewUserConfigFile(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ require (
github.com/avast/retry-go v3.0.0+incompatible
github.com/dave/jennifer v1.7.1
github.com/docker/go-units v0.5.0
github.com/ghodss/yaml v1.0.0
github.com/go-logr/logr v1.4.2
github.com/goccy/go-yaml v1.15.15
github.com/google/go-cmp v0.6.0
github.com/hashicorp/go-multierror v1.1.1
github.com/kelseyhightower/envconfig v1.4.0
Expand All @@ -25,7 +25,6 @@ require (
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c
golang.org/x/sync v0.10.0
golang.org/x/tools v0.29.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.26.15
k8s.io/apimachinery v0.26.15
k8s.io/client-go v0.26.15
Expand Down Expand Up @@ -101,6 +100,7 @@ require (
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.26.10 // indirect
k8s.io/component-base v0.26.10 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
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-faster/city v1.0.1 h1:4WAxSZ3V2Ws4QRDrscLEDcibJY8uf41H6AhXDrNDcGw=
github.com/go-faster/city v1.0.1/go.mod h1:jKcUJId49qdW3L1qKHH/3wPeUstCVpVSXTM6vO3VcTw=
github.com/go-faster/errors v0.7.1 h1:MkJTnDoEdi9pDabt1dpWf7AA8/BaSYZqibYyhZ20AYg=
Expand Down Expand Up @@ -125,6 +123,8 @@ github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/goccy/go-yaml v1.15.15 h1:5turdzAlutS2Q7/QR/9R99Z1K0J00qDb4T0pHJcZ5ew=
github.com/goccy/go-yaml v1.15.15/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
Expand Down

0 comments on commit e904a16

Please sign in to comment.