Skip to content
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 cmd/build/helmify/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"regexp"
"strings"

"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrueg should we just move to v4? are there breaking changes from v3 - v4?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to keep the change set minimal. v4 hasn't had an official release. latest is https://github.com/yaml/go-yaml/releases/tag/v4.0.0-rc.3

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/gator/expand/expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/open-policy-agent/gatekeeper/v3/pkg/gator/expand"
"github.com/open-policy-agent/gatekeeper/v3/pkg/gator/reader"
"github.com/spf13/cobra"
"gopkg.in/yaml.v2" // yaml.v3 inserts a space before '-', which is inconsistent with standard, kubernetes and kubebuilder format. yaml.v2 does not insert these spaces.
"go.yaml.in/yaml/v2"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/gator/test/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/open-policy-agent/gatekeeper/v3/pkg/gator/test"
"github.com/open-policy-agent/gatekeeper/v3/pkg/util"
"github.com/spf13/cobra"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
)

const (
Expand Down
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ require (
go.opentelemetry.io/otel/sdk v1.38.0
go.opentelemetry.io/otel/sdk/metric v1.38.0
go.uber.org/zap v1.27.1
go.yaml.in/yaml/v2 v2.4.2
go.yaml.in/yaml/v3 v3.0.4
golang.org/x/net v0.46.0
golang.org/x/oauth2 v0.30.0
golang.org/x/sync v0.17.0
golang.org/x/time v0.13.0
google.golang.org/grpc v1.75.1
google.golang.org/protobuf v1.36.11
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.34.3
k8s.io/apiextensions-apiserver v0.34.3
k8s.io/apimachinery v0.34.3
Expand Down Expand Up @@ -152,8 +152,6 @@ require (
go.opentelemetry.io/proto/otlp v1.7.1 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.43.0 // indirect
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect
golang.org/x/sys v0.37.0 // indirect
Expand All @@ -166,6 +164,7 @@ require (
google.golang.org/genproto/googleapis/rpc v0.0.0-20250825161204-c5933d9347a5 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/component-base v0.34.3 // indirect
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 // indirect
Expand Down
2 changes: 1 addition & 1 deletion pkg/expansion/fixtures/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/open-policy-agent/gatekeeper/v3/pkg/mutation/mutators/assignimage"
"github.com/open-policy-agent/gatekeeper/v3/pkg/mutation/mutators/assignmeta"
"github.com/open-policy-agent/gatekeeper/v3/pkg/mutation/types"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
Expand Down
2 changes: 1 addition & 1 deletion pkg/gator/verify/read_suites.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"

"github.com/open-policy-agent/gatekeeper/v3/pkg/gator"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/gator/yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package gator
import (
"encoding/json"

"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The import path "go.yaml.in/yaml/v3" appears to be incorrect. The standard maintained YAML library for Go uses the import path "gopkg.in/yaml.v3" (note the period before v3, not a slash). The repository at https://github.com/go-yaml/yaml documents that the correct import paths are:

  • gopkg.in/yaml.v3 for v3
  • gopkg.in/yaml.v2 for v2

Please verify that "go.yaml.in/yaml/v3" is a valid and maintained module. If the intention is to use the standard go-yaml library, the import should be "gopkg.in/yaml.v3" instead.

Suggested change
"go.yaml.in/yaml/v3"
"gopkg.in/yaml.v3"

Copilot uses AI. Check for mistakes.
)

func ParseYaml(yamlBytes []byte, v interface{}) error {
Expand Down
Loading