mirror of
https://github.com/siderolabs/sidero.git
synced 2025-10-27 06:21:09 +01:00
This cluster has a single controlplane node just for the sake of testing with another cluster in place. Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
32 lines
1.0 KiB
Go
32 lines
1.0 KiB
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 tests
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"sigs.k8s.io/controller-runtime/pkg/client"
|
|
|
|
"github.com/talos-systems/sidero/sfyra/pkg/capi"
|
|
"github.com/talos-systems/sidero/sfyra/pkg/talos"
|
|
"github.com/talos-systems/sidero/sfyra/pkg/vm"
|
|
)
|
|
|
|
const (
|
|
workloadClusterName = "workload-cluster"
|
|
workloadClusterLBPort = 20000
|
|
)
|
|
|
|
// TestWorkloadCluster deploys and destroys the workload cluster via CAPI.
|
|
func TestWorkloadCluster(ctx context.Context, metalClient client.Client, cluster talos.Cluster, vmSet *vm.Set, capiManager *capi.Manager) TestFunc {
|
|
return func(t *testing.T) {
|
|
loadbalancer, _ := deployCluster(ctx, t, metalClient, cluster, vmSet, capiManager, workloadClusterName, workloadServerClassName, workloadClusterLBPort, 1, 0)
|
|
defer loadbalancer.Close()
|
|
|
|
deleteCluster(ctx, t, metalClient, workloadClusterName)
|
|
}
|
|
}
|