Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release-1.26] Cluster reset from non boostrap nodes #8453

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions tests/e2e/snapshotrestore/Vagrantfile
Expand Up @@ -26,8 +26,6 @@ def provision(vm, role, role_num, node_num)
install_type = getInstallType(vm, RELEASE_VERSION, GITHUB_BRANCH)

vm.provision "shell", inline: "ping -c 2 k3s.io"

db_type = getDBType(role, role_num, vm)

if role.include?("server") && role_num == 0
vm.provision 'k3s-primary-server', type: 'k3s', run: 'once' do |k3s|
Expand Down
13 changes: 13 additions & 0 deletions tests/e2e/snapshotrestore/snapshotrestore_test.go
Expand Up @@ -124,6 +124,7 @@ var _ = Describe("Verify snapshots and cluster restores work", Ordered, func() {
})

})

Context("Cluster is reset normally", func() {
It("Resets the cluster", func() {
for _, nodeName := range serverNodeNames {
Expand All @@ -144,6 +145,17 @@ var _ = Describe("Verify snapshots and cluster restores work", Ordered, func() {
Expect(e2e.RunCmdOnNode(cmd, serverNodeNames[0])).Error().NotTo(HaveOccurred())
})

It("Resets non boostrap nodes", func() {
for _, nodeName := range serverNodeNames {
if nodeName != serverNodeNames[0] {
cmd := "k3s server --cluster-reset"
response, err := e2e.RunCmdOnNode(cmd, nodeName)
Expect(err).NotTo(HaveOccurred())
Expect(response).Should(ContainSubstring("Managed etcd cluster membership has been reset, restart without --cluster-reset flag now"))
}
}
})

It("Checks that other servers are not ready", func() {
fmt.Printf("\nFetching node status\n")
Eventually(func(g Gomega) {
Expand Down Expand Up @@ -209,6 +221,7 @@ var _ = Describe("Verify snapshots and cluster restores work", Ordered, func() {
})

})

Context("Cluster restores from snapshot", func() {
It("Restores the snapshot", func() {
//Stop k3s on all nodes
Expand Down