Skip to content

Commit 68e1074

Browse files
authored
Merge pull request #4105 from saschagrunert/yaml
Move away from archived `gopkg.in/yaml.v2`
2 parents 510a47e + 77e7c88 commit 68e1074

File tree

7 files changed

+10
-9
lines changed

7 files changed

+10
-9
lines changed

cmd/krel/cmd/release_notes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ import (
3434
gogit "github.com/go-git/go-git/v5"
3535
"github.com/sirupsen/logrus"
3636
"github.com/spf13/cobra"
37-
"gopkg.in/yaml.v2"
3837

3938
"sigs.k8s.io/release-sdk/git"
4039
"sigs.k8s.io/release-sdk/github"
4140
"sigs.k8s.io/release-utils/command"
4241
"sigs.k8s.io/release-utils/editor"
4342
"sigs.k8s.io/release-utils/helpers"
43+
"sigs.k8s.io/yaml"
4444

4545
"k8s.io/release/pkg/notes"
4646
"k8s.io/release/pkg/notes/document"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ require (
3333
github.com/stretchr/testify v1.11.1
3434
github.com/tj/go-spin v1.1.0
3535
github.com/yuin/goldmark v1.7.13
36+
go.yaml.in/yaml/v4 v4.0.0-rc.2
3637
golang.org/x/net v0.46.0
3738
golang.org/x/oauth2 v0.32.0
3839
golang.org/x/text v0.30.0
3940
google.golang.org/api v0.248.0
40-
gopkg.in/yaml.v2 v2.4.0
4141
k8s.io/apimachinery v0.34.1
4242
k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d
4343
sigs.k8s.io/bom v0.7.1

go.sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,8 @@ go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
989989
go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
990990
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
991991
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
992+
go.yaml.in/yaml/v4 v4.0.0-rc.2 h1:/FrI8D64VSr4HtGIlUtlFMGsm7H7pWTbj6vOLVZcA6s=
993+
go.yaml.in/yaml/v4 v4.0.0-rc.2/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0=
992994
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
993995
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
994996
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
@@ -1375,7 +1377,6 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
13751377
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
13761378
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
13771379
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
1378-
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
13791380
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
13801381
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
13811382
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

pkg/cve/impl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ import (
2727

2828
"cloud.google.com/go/storage"
2929
"github.com/sirupsen/logrus"
30-
"gopkg.in/yaml.v2"
3130

3231
"sigs.k8s.io/release-sdk/object"
32+
"sigs.k8s.io/yaml"
3333

3434
"k8s.io/release/pkg/notes"
3535
)

pkg/notes/notes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ import (
4343
"github.com/sirupsen/logrus"
4444
"golang.org/x/text/cases"
4545
"golang.org/x/text/language"
46-
"gopkg.in/yaml.v2"
4746

4847
"sigs.k8s.io/release-sdk/github"
48+
"sigs.k8s.io/yaml"
4949

5050
"k8s.io/release/pkg/notes/options"
5151
)

pkg/notes/notes_map.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"path/filepath"
2525

2626
"github.com/sirupsen/logrus"
27-
"gopkg.in/yaml.v2"
27+
"go.yaml.in/yaml/v4"
2828

2929
"sigs.k8s.io/release-sdk/object"
3030
)

pkg/notes/notes_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ func testApplyMapHelper(t *testing.T, testDir string, makeNewNote func() *Releas
440440
require.True(t, ok, "found map test without testcase")
441441

442442
// Read the property this test case checks
443-
property, ok := testcase.(map[any]any)["property"].(string)
443+
property, ok := testcase.(map[string]any)["property"].(string)
444444
require.True(t, ok)
445445
require.NotEmpty(t, property)
446446
require.NotEmpty(t, property, "testcase found without property")
@@ -451,10 +451,10 @@ func testApplyMapHelper(t *testing.T, testDir string, makeNewNote func() *Releas
451451
originalVal := reflect.Indirect(reflectedOriginalNote).FieldByName(property)
452452

453453
// Factor the test name
454-
testName, ok := testcase.(map[any]any)["name"].(string)
454+
testName, ok := testcase.(map[string]any)["name"].(string)
455455
require.True(t, ok)
456456

457-
switch expectedValue := testcase.(map[any]any)["expected"].(type) {
457+
switch expectedValue := testcase.(map[string]any)["expected"].(type) {
458458
case bool:
459459
actualVal := reflect.Indirect(reflectedNote).FieldByName(property).Bool()
460460
require.Equalf(t, expectedValue, actualVal, "Failed %s", testName)

0 commit comments

Comments
 (0)