Andrey Smirnov 032c99a030
refactor: remove pkg/resources dependencies on k8s and base62
This continues the process of removing extra dependencies before moving
`pkg/resources` into machinery.

See also: #4420 #4469

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
2021-11-15 17:41:11 +03:00

30 lines
834 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 cluster_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
clusteradapter "github.com/talos-systems/talos/internal/app/machined/pkg/adapters/cluster"
"github.com/talos-systems/talos/pkg/resources/cluster"
)
func TestIdentityGenerate(t *testing.T) {
var spec1, spec2 cluster.IdentitySpec
require.NoError(t, clusteradapter.IdentitySpec(&spec1).Generate())
require.NoError(t, clusteradapter.IdentitySpec(&spec2).Generate())
assert.NotEqual(t, spec1, spec2)
length := len(spec1.NodeID)
assert.GreaterOrEqual(t, length, 43)
assert.LessOrEqual(t, length, 44)
}