Skip to content

Commit 92eeaa4

Browse files
committed
fix: update YAML library
Update COSI, and stop using a fork of `gopkg.in/yaml.v3`, now we use new supported for of this library. Drop `MarshalYAMLBytes` for the machine config, as we actually marshal config as a string, and we don't need this at all. Make `talosctl` stop doing hacks on machine config for newer Talos, keep hacks for backwards compatibility. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
1 parent aa24da9 commit 92eeaa4

File tree

113 files changed

+234
-162
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+234
-162
lines changed

cmd/installer/cmd/imager/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/google/go-containerregistry/pkg/name"
1818
"github.com/siderolabs/gen/xslices"
1919
"github.com/spf13/cobra"
20-
"gopkg.in/yaml.v3"
20+
"go.yaml.in/yaml/v4"
2121

2222
"github.com/siderolabs/talos/cmd/installer/pkg/install"
2323
"github.com/siderolabs/talos/pkg/archiver"

cmd/installer/pkg/install/install.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"github.com/siderolabs/go-blockdevice/v2/partitioning/gpt"
2323
"github.com/siderolabs/go-pointer"
2424
"github.com/siderolabs/go-procfs/procfs"
25-
"gopkg.in/yaml.v3"
25+
"go.yaml.in/yaml/v4"
2626

2727
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime"
2828
"github.com/siderolabs/talos/internal/app/machined/pkg/runtime/v1alpha1/board"

cmd/talosctl/cmd/docs.go

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

1717
"github.com/spf13/cobra"
1818
"github.com/spf13/cobra/doc"
19-
"gopkg.in/yaml.v3"
19+
"go.yaml.in/yaml/v4"
2020

2121
"github.com/siderolabs/talos/pkg/machinery/config/encoder"
2222
"github.com/siderolabs/talos/pkg/machinery/config/types/block"

cmd/talosctl/cmd/mgmt/cluster/create/clusterops/configmaker/internal/makers/qemu.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"github.com/siderolabs/go-pointer"
1919
"github.com/siderolabs/go-procfs/procfs"
2020
sideronet "github.com/siderolabs/net"
21-
"gopkg.in/yaml.v3"
21+
"go.yaml.in/yaml/v4"
2222

2323
"github.com/siderolabs/talos/cmd/talosctl/cmd/mgmt/cluster/create/clusterops"
2424
"github.com/siderolabs/talos/cmd/talosctl/cmd/mgmt/cluster/create/clusterops/configmaker/internal/siderolinkbuilder"

cmd/talosctl/cmd/mgmt/gen/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/siderolabs/gen/xslices"
1818
sideronet "github.com/siderolabs/net"
1919
"github.com/spf13/cobra"
20-
"gopkg.in/yaml.v3"
20+
"go.yaml.in/yaml/v4"
2121

2222
"github.com/siderolabs/talos/cmd/talosctl/pkg/mgmt/helpers"
2323
"github.com/siderolabs/talos/pkg/images"

cmd/talosctl/cmd/mgmt/gen/secrets.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/spf13/cobra"
13-
"gopkg.in/yaml.v3"
13+
"go.yaml.in/yaml/v4"
1414

1515
"github.com/siderolabs/talos/pkg/machinery/config"
1616
"github.com/siderolabs/talos/pkg/machinery/config/configloader"

cmd/talosctl/cmd/talos/cgroups.go

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

1919
"github.com/siderolabs/gen/xslices"
2020
"github.com/spf13/cobra"
21-
"gopkg.in/yaml.v3"
21+
"go.yaml.in/yaml/v4"
2222

2323
"github.com/siderolabs/talos/cmd/talosctl/cmd/talos/cgroupsprinter"
2424
"github.com/siderolabs/talos/cmd/talosctl/pkg/talos/helpers"

cmd/talosctl/cmd/talos/cgroupsprinter/presets.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"strings"
1313

1414
"github.com/siderolabs/gen/xslices"
15-
"gopkg.in/yaml.v3"
15+
"go.yaml.in/yaml/v4"
1616
)
1717

1818
//go:embed presets/*.yaml

cmd/talosctl/cmd/talos/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ import (
2424
"github.com/ryanuber/go-glob"
2525
"github.com/siderolabs/gen/maps"
2626
"github.com/spf13/cobra"
27+
"go.yaml.in/yaml/v4"
2728
"google.golang.org/protobuf/types/known/durationpb"
28-
"gopkg.in/yaml.v3"
2929

3030
"github.com/siderolabs/talos/cmd/talosctl/pkg/talos/helpers"
3131
machineapi "github.com/siderolabs/talos/pkg/machinery/api/machine"

cmd/talosctl/cmd/talos/edit.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919
"github.com/cosi-project/runtime/pkg/resource"
2020
"github.com/spf13/cobra"
2121
"google.golang.org/protobuf/types/known/durationpb"
22-
"gopkg.in/yaml.v3"
2322
"k8s.io/kubectl/pkg/cmd/util/editor"
2423
"k8s.io/kubectl/pkg/cmd/util/editor/crlf"
2524

@@ -66,7 +65,7 @@ func editFn(c *client.Client) func(context.Context, string, resource.Resource, e
6665
return nil
6766
}
6867

69-
body, err := yaml.Marshal(mc.Spec())
68+
body, err := extractMachineConfigBody(mc)
7069
if err != nil {
7170
return err
7271
}

0 commit comments

Comments
 (0)