Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions tests/e2e/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,11 @@ func InstallBackupOperator(k *kubectl.Kubectl) {

// backupRscSet should be used for newer versions
switch {
case strings.Contains(rancherVersion, ":v2.14"):
backupRestoreVersion = "v9.0.1"
backupRscSet = "rancher-resource-set-full"
case strings.Contains(rancherVersion, ":v2.13"):
backupRestoreVersion = "v9.0.0"
backupRestoreVersion = "v9.0.1"
backupRscSet = "rancher-resource-set-full"
case strings.Contains(rancherVersion, ":v2.12"):
backupRestoreVersion = "v8.1.1"
Expand Down Expand Up @@ -706,21 +709,21 @@ Wait for all pods to be Running/Succeeded in the current K8s cluster
- @returns Nothing, the function will fail through Ginkgo in case of issue
*/
func WaitForAllPods() {
// Extract list of pods
pods, _ := kubectl.RunWithoutErr("get", "pod", "--all-namespaces",
"-o", "jsonpath={.items[*].metadata.name}")
// Log pods list, useful for debugging
podDetails, _ := kubectl.RunWithoutErr("get", "pod", "--all-namespaces")
GinkgoWriter.Printf("%s\n", podDetails)

for _, p := range strings.Fields(pods) {
Eventually(func() string {
// We have to search for p in all namespaces as we don't know them in advance
status, _ := kubectl.RunWithoutErr("get", "pod", "--all-namespaces",
"-o", "jsonpath={.items[?(@.metadata.name==\""+p+"\")].status.phase}")
return status
}, tools.SetTimeout(8*time.Minute), 30*time.Second).Should(Or(
ContainSubstring("Running"),
ContainSubstring("Succeeded"),
))
}
okStatus := strings.NewReplacer("Running", "", "Succeeded", "", "Completed", "")
Eventually(func() string {
podStatus, _ := kubectl.RunWithoutErr("get", "pod", "--all-namespaces",
"-o", "jsonpath={.items[*].status.phase}")
s := strings.TrimSpace(okStatus.Replace(podStatus))

// Log pods status, useful for debugging
GinkgoWriter.Printf("Pods Status: %s\n", s)

return s
}, tools.SetTimeout(4*time.Minute), 30*time.Second).Should(BeEmpty())
}

/*
Expand Down
Loading