Skip to content

Commit 6bd3f00

Browse files
committed
Move away from archived gopkg.in/yaml.v2
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
1 parent 7b4f4be commit 6bd3f00

File tree

7 files changed

+12
-9
lines changed

7 files changed

+12
-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: 2 additions & 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.43.0
3738
golang.org/x/oauth2 v0.30.0
3839
golang.org/x/text v0.28.0
3940
google.golang.org/api v0.246.0
40-
gopkg.in/yaml.v2 v2.4.0
4141
k8s.io/apimachinery v0.34.0
4242
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
4343
sigs.k8s.io/bom v0.6.1-0.20250809182942-3af5abaeaa9e
@@ -310,6 +310,7 @@ require (
310310
gopkg.in/inf.v0 v0.9.1 // indirect
311311
gopkg.in/ini.v1 v1.67.0 // indirect
312312
gopkg.in/warnings.v0 v0.1.2 // indirect
313+
gopkg.in/yaml.v2 v2.4.0 // indirect
313314
gopkg.in/yaml.v3 v3.0.1 // indirect
314315
k8s.io/api v0.34.0 // indirect
315316
k8s.io/client-go v0.34.0 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,8 @@ go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
967967
go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
968968
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
969969
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
970+
go.yaml.in/yaml/v4 v4.0.0-rc.2 h1:/FrI8D64VSr4HtGIlUtlFMGsm7H7pWTbj6vOLVZcA6s=
971+
go.yaml.in/yaml/v4 v4.0.0-rc.2/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0=
970972
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
971973
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
972974
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=

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
@@ -41,9 +41,9 @@ import (
4141
"github.com/sirupsen/logrus"
4242
"golang.org/x/text/cases"
4343
"golang.org/x/text/language"
44-
"gopkg.in/yaml.v2"
4544

4645
"sigs.k8s.io/release-sdk/github"
46+
"sigs.k8s.io/yaml"
4747

4848
"k8s.io/release/pkg/notes/options"
4949
)

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: 4 additions & 4 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[interface{}]interface{})["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[interface{}]interface{})["name"].(string)
454+
testName, ok := testcase.(map[string]any)["name"].(string)
455455
require.True(t, ok)
456456

457-
switch expectedValue := testcase.(map[interface{}]interface{})["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)
@@ -464,7 +464,7 @@ func testApplyMapHelper(t *testing.T, testDir string, makeNewNote func() *Releas
464464
actualVal := reflect.Indirect(reflectedNote).FieldByName(property).String()
465465
require.Equalf(t, expectedValue, actualVal, "Failed %s", testName)
466466
require.NotEqualf(t, expectedValue, originalVal.String(), "Failed %s", testName)
467-
case []interface{}:
467+
case []any:
468468
// Handle string slice cases
469469
actualVal := reflect.Indirect(reflectedNote).FieldByName(property)
470470
actualSlice := make([]string, 0)

0 commit comments

Comments
 (0)