Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
camilamacedo86 committed Mar 31, 2024
1 parent 1d3815f commit 709b688
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion test/e2e/v4/plugin_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,24 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller bool) {
err = kbc.LoadImageToKindCluster()
ExpectWithOffset(1, err).NotTo(HaveOccurred())

By("ensuring all cert-manager pods are ready")
certManagerPodsReady := func() error {
output, err := kbc.Kubectl.Get(
true,
"pods",
"--namespace", "cert-manager",
"--field-selector=status.phase!=Running",
)
if err != nil {
return err
}
if output != "" {
return fmt.Errorf("not all cert-manager pods are running: %s", output)
}
return nil
}
Eventually(certManagerPodsReady, 5*time.Minute, 10*time.Second).Should(Succeed())

var output []byte
if !isToUseInstaller {
// NOTE: If you want to run the test against a GKE cluster, you will need to grant yourself permission.
Expand All @@ -158,7 +176,7 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller bool) {
// https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control
By("deploying the controller-manager with the installer")

_, err = kbc.Kubectl.Apply(true, "-f", "dist/install.yaml")
_, err = kbc.Kubectl.Apply(true, "--save-config", "-f", "dist/install.yaml")
ExpectWithOffset(1, err).NotTo(HaveOccurred())
}

Expand Down Expand Up @@ -217,6 +235,16 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller bool) {
"secrets", "webhook-server-cert")
return err
}, time.Minute, time.Second).Should(Succeed())

By("checking cert-manager webhook is ready")
_, err = kbc.Kubectl.Get(
true,
"pods",
"-l", "app.kubernetes.io/name=webhook",
"-n", "cert-manager",
"-o", "jsonpath={.items[*].status.conditions[?(@.type=='Ready')].status}",
)
Expect(err).NotTo(HaveOccurred(), "cert-manager webhook should be ready")
}

By("validating that the Prometheus manager has provisioned the Service")
Expand Down

0 comments on commit 709b688

Please sign in to comment.