Skip to content

Commit c435614

Browse files
saracenash2k
andcommitted
Merge branch 'ash2k/yaml-upgrade' into 'main'
Switch to a maintained YAML library go.yaml.in/yaml/v3 See merge request https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/6065 Merged-by: Arran Walker <ajwalker@gitlab.com> Approved-by: Timo Furrer <tfurrer@gitlab.com> Approved-by: Arran Walker <ajwalker@gitlab.com> Reviewed-by: Mikhail Mazurskiy <mmazurskiy@gitlab.com> Co-authored-by: Mikhail Mazurskiy <mmazurskiy@gitlab.com>
2 parents b592f84 + 4c64511 commit c435614

7 files changed

Lines changed: 14 additions & 15 deletions

File tree

go.mod

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ require (
5353
github.com/klauspost/compress v1.18.2
5454
github.com/klauspost/pgzip v1.2.6
5555
github.com/magefile/mage v1.15.0
56-
github.com/minio/minio-go/v7 v7.0.97
56+
github.com/minio/minio-go/v7 v7.0.98
5757
github.com/moby/docker-image-spec v1.3.1
5858
github.com/openbao/openbao/api/v2 v2.5.0
5959
github.com/opencontainers/image-spec v1.1.1
@@ -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

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,8 @@ github.com/minio/crc64nvme v1.1.1 h1:8dwx/Pz49suywbO+auHCBpCtlW1OfpcLN7wYgVR6wAI
453453
github.com/minio/crc64nvme v1.1.1/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg=
454454
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
455455
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
456-
github.com/minio/minio-go/v7 v7.0.97 h1:lqhREPyfgHTB/ciX8k2r8k0D93WaFqxbJX36UZq5occ=
457-
github.com/minio/minio-go/v7 v7.0.97/go.mod h1:re5VXuo0pwEtoNLsNuSr0RrLfT/MBtohwdaSmPPSRSk=
456+
github.com/minio/minio-go/v7 v7.0.98 h1:MeAVKjLVz+XJ28zFcuYyImNSAh8Mq725uNW4beRisi0=
457+
github.com/minio/minio-go/v7 v7.0.98/go.mod h1:cY0Y+W7yozf0mdIclrttzo1Iiu7mEf9y7nk2uXqMOvM=
458458
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
459459
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
460460
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=

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)