diff --git a/cmd/krel/cmd/release_notes.go b/cmd/krel/cmd/release_notes.go index cc44bd17250..9ad3cb66c8c 100644 --- a/cmd/krel/cmd/release_notes.go +++ b/cmd/krel/cmd/release_notes.go @@ -34,13 +34,13 @@ import ( gogit "github.com/go-git/go-git/v5" "github.com/sirupsen/logrus" "github.com/spf13/cobra" - "gopkg.in/yaml.v2" "sigs.k8s.io/release-sdk/git" "sigs.k8s.io/release-sdk/github" "sigs.k8s.io/release-utils/command" "sigs.k8s.io/release-utils/editor" "sigs.k8s.io/release-utils/helpers" + "sigs.k8s.io/yaml" "k8s.io/release/pkg/notes" "k8s.io/release/pkg/notes/document" diff --git a/go.mod b/go.mod index 0f7f09c905a..7dd4aad45bb 100644 --- a/go.mod +++ b/go.mod @@ -33,11 +33,11 @@ require ( github.com/stretchr/testify v1.11.1 github.com/tj/go-spin v1.1.0 github.com/yuin/goldmark v1.7.13 + go.yaml.in/yaml/v4 v4.0.0-rc.2 golang.org/x/net v0.43.0 golang.org/x/oauth2 v0.30.0 golang.org/x/text v0.28.0 google.golang.org/api v0.246.0 - gopkg.in/yaml.v2 v2.4.0 k8s.io/apimachinery v0.34.0 k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 sigs.k8s.io/bom v0.6.1-0.20250809182942-3af5abaeaa9e @@ -310,6 +310,7 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/api v0.34.0 // indirect k8s.io/client-go v0.34.0 // indirect diff --git a/go.sum b/go.sum index 969bc6e3228..0bf18cf5201 100644 --- a/go.sum +++ b/go.sum @@ -967,6 +967,8 @@ go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +go.yaml.in/yaml/v4 v4.0.0-rc.2 h1:/FrI8D64VSr4HtGIlUtlFMGsm7H7pWTbj6vOLVZcA6s= +go.yaml.in/yaml/v4 v4.0.0-rc.2/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/pkg/cve/impl.go b/pkg/cve/impl.go index 84ac343cedd..bd647de94b4 100644 --- a/pkg/cve/impl.go +++ b/pkg/cve/impl.go @@ -27,9 +27,9 @@ import ( "cloud.google.com/go/storage" "github.com/sirupsen/logrus" - "gopkg.in/yaml.v2" "sigs.k8s.io/release-sdk/object" + "sigs.k8s.io/yaml" "k8s.io/release/pkg/notes" ) diff --git a/pkg/notes/notes.go b/pkg/notes/notes.go index f598d586e3e..b2a8bc244dd 100644 --- a/pkg/notes/notes.go +++ b/pkg/notes/notes.go @@ -41,9 +41,9 @@ import ( "github.com/sirupsen/logrus" "golang.org/x/text/cases" "golang.org/x/text/language" - "gopkg.in/yaml.v2" "sigs.k8s.io/release-sdk/github" + "sigs.k8s.io/yaml" "k8s.io/release/pkg/notes/options" ) diff --git a/pkg/notes/notes_map.go b/pkg/notes/notes_map.go index 109f3d511a1..4d69709fc24 100644 --- a/pkg/notes/notes_map.go +++ b/pkg/notes/notes_map.go @@ -24,7 +24,7 @@ import ( "path/filepath" "github.com/sirupsen/logrus" - "gopkg.in/yaml.v2" + "go.yaml.in/yaml/v4" "sigs.k8s.io/release-sdk/object" ) diff --git a/pkg/notes/notes_test.go b/pkg/notes/notes_test.go index a802931c379..990a628dc3f 100644 --- a/pkg/notes/notes_test.go +++ b/pkg/notes/notes_test.go @@ -440,7 +440,7 @@ func testApplyMapHelper(t *testing.T, testDir string, makeNewNote func() *Releas require.True(t, ok, "found map test without testcase") // Read the property this test case checks - property, ok := testcase.(map[interface{}]interface{})["property"].(string) + property, ok := testcase.(map[string]any)["property"].(string) require.True(t, ok) require.NotEmpty(t, property) require.NotEmpty(t, property, "testcase found without property") @@ -451,10 +451,10 @@ func testApplyMapHelper(t *testing.T, testDir string, makeNewNote func() *Releas originalVal := reflect.Indirect(reflectedOriginalNote).FieldByName(property) // Factor the test name - testName, ok := testcase.(map[interface{}]interface{})["name"].(string) + testName, ok := testcase.(map[string]any)["name"].(string) require.True(t, ok) - switch expectedValue := testcase.(map[interface{}]interface{})["expected"].(type) { + switch expectedValue := testcase.(map[string]any)["expected"].(type) { case bool: actualVal := reflect.Indirect(reflectedNote).FieldByName(property).Bool() require.Equalf(t, expectedValue, actualVal, "Failed %s", testName) @@ -464,7 +464,7 @@ func testApplyMapHelper(t *testing.T, testDir string, makeNewNote func() *Releas actualVal := reflect.Indirect(reflectedNote).FieldByName(property).String() require.Equalf(t, expectedValue, actualVal, "Failed %s", testName) require.NotEqualf(t, expectedValue, originalVal.String(), "Failed %s", testName) - case []interface{}: + case []any: // Handle string slice cases actualVal := reflect.Indirect(reflectedNote).FieldByName(property) actualSlice := make([]string, 0)