talos/internal/pkg/toml/merge_test.go
Andrey Smirnov 6ffc381c59
feat: implement CRI configuration customization
This is tricky, as containerd doesn't merge itself plugin configuration
across multiple files. TOML can't load configuration correctly from
concatenated files.

Fixes #6390

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2022-11-16 15:38:44 +04:00

30 lines
631 B
Go

// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package toml_test
import (
_ "embed"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/siderolabs/talos/internal/pkg/toml"
)
//go:embed testdata/expected.toml
var expected []byte
func TestMerge(t *testing.T) {
out, err := toml.Merge([]string{
"testdata/1.toml",
"testdata/2.toml",
"testdata/3.toml",
})
require.NoError(t, err)
assert.Equal(t, expected, out)
}