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

ci: use WaitForNamespaceWithPod function #866

Merged
merged 1 commit into from
Jun 9, 2023
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
31 changes: 16 additions & 15 deletions tests/e2e/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,17 @@ var _ = Describe("E2E - Install Rancher Manager", Label("install"), func() {
err := os.Setenv("KUBECONFIG", "/etc/rancher/rke2/rke2.yaml")
Expect(err).To(Not(HaveOccurred()))

err = k.WaitForPod("kube-system", "k8s-app=kube-dns", "rke2-coredns")
err = k.WaitForNamespaceWithPod("kube-system", "k8s-app=kube-dns")
Expect(err).To(Not(HaveOccurred()))

err = k.WaitForPod("kube-system", "app=rke2-metrics-server", "rke2-metrics-server")
err = k.WaitForNamespaceWithPod("kube-system", "app=rke2-metrics-server")
Expect(err).To(Not(HaveOccurred()))

err = k.WaitForPod("kube-system", "app.kubernetes.io/name=rke2-ingress-nginx", "rke2-ingress-nginx-controller")
err = k.WaitForNamespaceWithPod("kube-system", "app.kubernetes.io/name=rke2-ingress-nginx")
Expect(err).To(Not(HaveOccurred()))

err = k.WaitLabelFilter("kube-system", "Ready", "rke2-ingress-nginx-controller", "app.kubernetes.io/name=rke2-ingress-nginx")
Expect(err).To(Not(HaveOccurred()))

// Wait for all services to be started but it will be removed later
// after reworking WaitForPod function
time.Sleep(misc.SetTimeout(60 * time.Second))
})
} else {
By("Installing K3s", func() {
Expand Down Expand Up @@ -131,19 +127,19 @@ var _ = Describe("E2E - Install Rancher Manager", Label("install"), func() {

By("Waiting for K3s to be started", func() {
// Wait for all pods to be started
err := k.WaitForPod("kube-system", "app=local-path-provisioner", "local-path-provisioner")
err := k.WaitForNamespaceWithPod("kube-system", "app=local-path-provisioner")
Expect(err).To(Not(HaveOccurred()))

err = k.WaitForPod("kube-system", "k8s-app=kube-dns", "coredns")
err = k.WaitForNamespaceWithPod("kube-system", "k8s-app=kube-dns")
Expect(err).To(Not(HaveOccurred()))

err = k.WaitForPod("kube-system", "k8s-app=metrics-server", "metrics-server")
err = k.WaitForNamespaceWithPod("kube-system", "k8s-app=metrics-server")
Expect(err).To(Not(HaveOccurred()))

err = k.WaitForPod("kube-system", "app.kubernetes.io/name=traefik", "traefik")
err = k.WaitForNamespaceWithPod("kube-system", "app.kubernetes.io/name=traefik")
Expect(err).To(Not(HaveOccurred()))

err = k.WaitForPod("kube-system", "svccontroller.k3s.cattle.io/svcname=traefik", "svclb-traefik")
err = k.WaitForNamespaceWithPod("kube-system", "svccontroller.k3s.cattle.io/svcname=traefik")
Expect(err).To(Not(HaveOccurred()))
})
}
Expand Down Expand Up @@ -287,9 +283,14 @@ var _ = Describe("E2E - Install Rancher Manager", Label("install"), func() {

// Check issuer for Private CA
if caType == "private" {
out, err := exec.Command("bash", "-c", "curl -vk https://"+rancherHostname).CombinedOutput()
GinkgoWriter.Printf("%s\n", out)
Expect(err).To(Not(HaveOccurred()))
Eventually(func() error {
out, err := exec.Command("bash", "-c", "curl -vk https://"+rancherHostname).CombinedOutput()
if err != nil {
// Show only if there's no error
GinkgoWriter.Printf("%s\n", out)
}
return err
}, misc.SetTimeout(2*time.Minute), 5*time.Second).Should(Not(HaveOccurred()))
}
})

Expand Down