Skip to content

Commit 40fdfa3

Browse files
committed
Switch to a maintained YAML library go.yaml.in/yaml/v3
1 parent d8ad62e commit 40fdfa3

6 files changed

Lines changed: 11 additions & 12 deletions

File tree

go.mod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ require (
8383
gitlab.com/gitlab-org/step-runner v0.24.0
8484
go.mozilla.org/pkcs7 v0.9.0
8585
go.uber.org/automaxprocs v1.6.0
86+
go.yaml.in/yaml/v3 v3.0.4
8687
gocloud.dev v0.44.0
8788
golang.org/x/crypto v0.46.0
8889
golang.org/x/oauth2 v0.34.0
@@ -92,8 +93,6 @@ require (
9293
google.golang.org/api v0.259.0
9394
google.golang.org/grpc v1.78.0
9495
google.golang.org/protobuf v1.36.11
95-
gopkg.in/yaml.v2 v2.4.0
96-
gopkg.in/yaml.v3 v3.0.1
9796
k8s.io/api v0.35.0
9897
k8s.io/apimachinery v0.35.0
9998
k8s.io/client-go v0.35.0
@@ -281,7 +280,6 @@ require (
281280
go.shabbyrobe.org/gocovmerge v0.0.0-20230507111327-fa4f82cfbf4d // indirect
282281
go.uber.org/multierr v1.11.0 // indirect
283282
go.yaml.in/yaml/v2 v2.4.3 // indirect
284-
go.yaml.in/yaml/v3 v3.0.4 // indirect
285283
golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 // indirect
286284
golang.org/x/mod v0.31.0 // indirect
287285
golang.org/x/net v0.48.0 // indirect
@@ -295,6 +293,7 @@ require (
295293
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
296294
gopkg.in/inf.v0 v0.9.1 // indirect
297295
gopkg.in/warnings.v0 v0.1.2 // indirect
296+
gopkg.in/yaml.v3 v3.0.1 // indirect
298297
gotest.tools/v3 v3.5.2 // indirect
299298
k8s.io/klog/v2 v2.130.1 // indirect
300299
k8s.io/kube-openapi v0.0.0-20251125145642-4e65d59e963e // indirect

helpers/converter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"fmt"
77

88
"github.com/BurntSushi/toml"
9-
"gopkg.in/yaml.v2"
9+
"go.yaml.in/yaml/v3"
1010
)
1111

1212
func ToYAML(src interface{}) string {

helpers/converter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88

99
"github.com/stretchr/testify/assert"
1010
"github.com/stretchr/testify/require"
11-
"gopkg.in/yaml.v2"
11+
"go.yaml.in/yaml/v3"
1212
)
1313

1414
type TestObj struct {

magefiles/pulp/releases.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"time"
1111

1212
"github.com/samber/lo"
13-
"gopkg.in/yaml.v3"
13+
"go.yaml.in/yaml/v3"
1414
)
1515

1616
const (

steps/steps.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"gitlab.com/gitlab-org/step-runner/pkg/api/client"
99
"gitlab.com/gitlab-org/step-runner/schema/v1"
10-
"gopkg.in/yaml.v2"
10+
"go.yaml.in/yaml/v3"
1111

1212
"gitlab.com/gitlab-org/gitlab-runner/common"
1313
"gitlab.com/gitlab-org/gitlab-runner/common/spec"

steps/steps_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ func Test_addStepsPreamble(t *testing.T) {
1717
}{
1818
"simple script": {
1919
in: `[{"name":"script", "script": "foo bar baz"}]`,
20-
want: "{}\n---\nrun:\n- name: script\n script: foo bar baz\n",
20+
want: "{}\n---\nrun:\n - name: script\n script: foo bar baz\n",
2121
},
2222
"reference local step": {
2323
in: `[{"name":"local", "func":"./some/step", "inputs":{"in":"bar"}}]`,
24-
want: "{}\n---\nrun:\n- inputs:\n in: bar\n name: local\n func: ./some/step\n",
24+
want: "{}\n---\nrun:\n - inputs:\n in: bar\n name: local\n func: ./some/step\n",
2525
},
2626
"reference remote step": {
2727
in: `[{"name":"remote", "func":"https://gitlab.com/components/script@v1", "inputs":{"in":"bar"}}]`,
28-
want: "{}\n---\nrun:\n- inputs:\n in: bar\n name: remote\n func: https://gitlab.com/components/script@v1\n",
28+
want: "{}\n---\nrun:\n - inputs:\n in: bar\n name: remote\n func: https://gitlab.com/components/script@v1\n",
2929
},
3030
"action step": {
3131
in: `[{"name":"action", "action":"some-action@v1", "inputs":{"in":"bar"}}]`,
32-
want: "{}\n---\nrun:\n- action: some-action@v1\n inputs:\n in: bar\n name: action\n",
32+
want: "{}\n---\nrun:\n - action: some-action@v1\n inputs:\n in: bar\n name: action\n",
3333
},
3434
"exec step": {
3535
in: `[{"name":"exec", "exec":{"command":["cmd","arg1", "arg2"],"work_dir":"/foo/bar/baz"}, "inputs":{"in":"bar"}}]`,
36-
want: "{}\n---\nrun:\n- exec:\n command:\n - cmd\n - arg1\n - arg2\n work_dir: /foo/bar/baz\n inputs:\n in: bar\n name: exec\n",
36+
want: "{}\n---\nrun:\n - exec:\n command:\n - cmd\n - arg1\n - arg2\n work_dir: /foo/bar/baz\n inputs:\n in: bar\n name: exec\n",
3737
},
3838
}
3939

0 commit comments

Comments
 (0)