Skip to content

Commit

Permalink
Upgrade cert-manager version used from v1.5.3 to v1.14.4
Browse files Browse the repository at this point in the history
  • Loading branch information
camilamacedo86 committed Mar 31, 2024
1 parent cdc9c48 commit b9de188
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
prometheusOperatorURL = "https://github.com/prometheus-operator/prometheus-operator/" +
"releases/download/%s/bundle.yaml"

certmanagerVersion = "v1.5.3"
certmanagerVersion = "v1.14.4"
certmanagerURLTmpl = "https://github.com/jetstack/cert-manager/releases/download/%s/cert-manager.yaml"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
prometheusOperatorURL = "https://github.com/prometheus-operator/prometheus-operator/" +
"releases/download/%s/bundle.yaml"

certmanagerVersion = "v1.5.3"
certmanagerVersion = "v1.14.4"
certmanagerURLTmpl = "https://github.com/jetstack/cert-manager/releases/download/%s/cert-manager.yaml"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
prometheusOperatorURL = "https://github.com/prometheus-operator/prometheus-operator/" +
"releases/download/%s/bundle.yaml"

certmanagerVersion = "v1.5.3"
certmanagerVersion = "v1.14.4"
certmanagerURLTmpl = "https://github.com/jetstack/cert-manager/releases/download/%s/cert-manager.yaml"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const (
prometheusOperatorURL = "https://github.com/prometheus-operator/prometheus-operator/" +
"releases/download/%s/bundle.yaml"
certmanagerVersion = "v1.5.3"
certmanagerVersion = "v1.14.4"
certmanagerURLTmpl = "https://github.com/jetstack/cert-manager/releases/download/%s/cert-manager.yaml"
)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/utils/test_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
)

const (
certmanagerVersion = "v1.5.3"
certmanagerVersion = "v1.14.4"
certmanagerURLTmpl = "https://github.com/cert-manager/cert-manager/releases/download/%s/cert-manager.yaml"
prometheusOperatorVersion = "0.51"
prometheusOperatorURL = "https://raw.githubusercontent.com/prometheus-operator/" +
Expand Down
38 changes: 34 additions & 4 deletions test/e2e/v4/plugin_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ var _ = Describe("kubebuilder", func() {
By("removing controller image and working dir")
kbc.Destroy()
})
It("should generate a runnable project"+
" with restricted pods", func() {
kbc.IsRestricted = true
It("should generate a runnable project", func() {
kbc.IsRestricted = false
GenerateV4(kbc)
Run(kbc, true, false)
})
Expand All @@ -95,6 +94,7 @@ var _ = Describe("kubebuilder", func() {
})
It("should generate a runnable project"+
" with the Installer", func() {
kbc.IsRestricted = false
GenerateV4(kbc)
Run(kbc, false, true)
})
Expand Down Expand Up @@ -134,6 +134,26 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller bool) {
err = kbc.LoadImageToKindCluster()
ExpectWithOffset(1, err).NotTo(HaveOccurred())

if !kbc.IsRestricted {
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 Down Expand Up @@ -162,7 +182,7 @@ func Run(kbc *utils.TestContext, hasWebhook, isToUseInstaller bool) {
ExpectWithOffset(1, err).NotTo(HaveOccurred())
}

if kbc.IsRestricted && !isToUseInstaller {
if kbc.IsRestricted {
By("validating that manager Pod/container(s) are restricted")
ExpectWithOffset(1, output).NotTo(ContainSubstring("Warning: would violate PodSecurity"))
}
Expand Down Expand Up @@ -217,6 +237,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
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
prometheusOperatorURL = "https://github.com/prometheus-operator/prometheus-operator/" +
"releases/download/%s/bundle.yaml"

certmanagerVersion = "v1.5.3"
certmanagerVersion = "v1.14.4"
certmanagerURLTmpl = "https://github.com/jetstack/cert-manager/releases/download/%s/cert-manager.yaml"
)

Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-multigroup/test/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
prometheusOperatorURL = "https://github.com/prometheus-operator/prometheus-operator/" +
"releases/download/%s/bundle.yaml"

certmanagerVersion = "v1.5.3"
certmanagerVersion = "v1.14.4"
certmanagerURLTmpl = "https://github.com/jetstack/cert-manager/releases/download/%s/cert-manager.yaml"
)

Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-with-deploy-image/test/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
prometheusOperatorURL = "https://github.com/prometheus-operator/prometheus-operator/" +
"releases/download/%s/bundle.yaml"

certmanagerVersion = "v1.5.3"
certmanagerVersion = "v1.14.4"
certmanagerURLTmpl = "https://github.com/jetstack/cert-manager/releases/download/%s/cert-manager.yaml"
)

Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4-with-grafana/test/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
prometheusOperatorURL = "https://github.com/prometheus-operator/prometheus-operator/" +
"releases/download/%s/bundle.yaml"

certmanagerVersion = "v1.5.3"
certmanagerVersion = "v1.14.4"
certmanagerURLTmpl = "https://github.com/jetstack/cert-manager/releases/download/%s/cert-manager.yaml"
)

Expand Down
2 changes: 1 addition & 1 deletion testdata/project-v4/test/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
prometheusOperatorURL = "https://github.com/prometheus-operator/prometheus-operator/" +
"releases/download/%s/bundle.yaml"

certmanagerVersion = "v1.5.3"
certmanagerVersion = "v1.14.4"
certmanagerURLTmpl = "https://github.com/jetstack/cert-manager/releases/download/%s/cert-manager.yaml"
)

Expand Down

0 comments on commit b9de188

Please sign in to comment.