Skip to content

Commit

Permalink
Add rebuild task to the decommission_dc e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
burmanm committed Oct 16, 2023
1 parent f9388c9 commit 1b4961e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
10 changes: 10 additions & 0 deletions tests/decommission_dc/decommission_dc_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var (
dc1Label = fmt.Sprintf("cassandra.datastax.com/datacenter=%s", api.CleanupForKubernetes(dc1OverrideName))
dc2Label = fmt.Sprintf("cassandra.datastax.com/datacenter=%s", dc2Name)
seedLabel = "cassandra.datastax.com/seed-node=true"
taskYaml = "../testdata/tasks/rebuild_dc_task.yaml"
// dcLabel = fmt.Sprintf("cassandra.datastax.com/datacenter=%s", dcName)
ns = ginkgo_util.NewWrapper(testName, namespace)
)
Expand Down Expand Up @@ -127,6 +128,15 @@ var _ = Describe(testName, func() {
ns.ExpectDoneReconciling(dc1Name)
ns.ExpectDoneReconciling(dc2Name)

// Create a CassandraTask to rebuild dc2 from dc1
// Create CassandraTask that should replace a node
step = "creating a cassandra rebuild dc2"
k = kubectl.ApplyFiles(taskYaml)
ns.ExecAndLog(step, k)

// Wait for the task to be completed
ns.WaitForCompleteTask("rebuild-dc")

podNames := ns.GetDatacenterReadyPodNames(dc1OverrideName)
Expect(len(podNames)).To(Equal(2))
dcs := findDatacenters(podNames[0])
Expand Down
5 changes: 3 additions & 2 deletions tests/node_move/node_move_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ package node_move

import (
"fmt"
"testing"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"testing"

"github.com/k8ssandra/cass-operator/tests/kustomize"
ginkgo_util "github.com/k8ssandra/cass-operator/tests/util/ginkgo"
Expand Down Expand Up @@ -60,7 +61,7 @@ var _ = Describe(testName, func() {
})
Specify("the operator can move a cassandra node to a new token", func() {

// Create CassandraTask that should replace a node
// Create CassandraTask that should move tokens
step := "creating a cassandra task to move a node"
k := kubectl.ApplyFiles(taskYaml)
ns.ExecAndLog(step, k)
Expand Down
13 changes: 13 additions & 0 deletions tests/testdata/tasks/rebuild_task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: control.k8ssandra.io/v1alpha1
kind: CassandraTask
metadata:
name: rebuild-dc
spec:
datacenter:
name: dc2
namespace: test-decommission-dc
jobs:
- name: rebuild-dc2
command: rebuild
args:
datacenter: dc1

0 comments on commit 1b4961e

Please sign in to comment.