Skip to content

Commit

Permalink
OSSM-6930: Resolve certmanager conflict for IBM Z&P (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
unsortedhashsets authored Aug 13, 2024
1 parent f3591e5 commit cec403a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
16 changes: 14 additions & 2 deletions pkg/certmanageroperator/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
_ "embed"
"time"

"github.com/maistra/maistra-test-tool/pkg/util/check/assert"
"github.com/maistra/maistra-test-tool/pkg/util/oc"
"github.com/maistra/maistra-test-tool/pkg/util/operator"
"github.com/maistra/maistra-test-tool/pkg/util/pod"
Expand Down Expand Up @@ -43,8 +44,19 @@ func install(t test.TestHelper) {

t.LogStep("Wait for cert manager control plane")
oc.WaitPodReadyWithOptions(t, retry.Options().MaxAttempts(70).DelayBetweenAttempts(5*time.Second), pod.MatchingSelector("app=cert-manager", certManagerNs))
// oc.WaitPodReadyWithOptions(t, retry.Options().MaxAttempts(70).DelayBetweenAttempts(5*time.Second), pod.MatchingSelector("app=cainjector", certManagerNs))
// oc.WaitPodReadyWithOptions(t, retry.Options().MaxAttempts(70).DelayBetweenAttempts(5*time.Second), pod.MatchingSelector("app=webhook", certManagerNs))
oc.WaitPodReadyWithOptions(t, retry.Options().MaxAttempts(70).DelayBetweenAttempts(5*time.Second), pod.MatchingSelector("app=cainjector", certManagerNs))
oc.WaitPodReadyWithOptions(t, retry.Options().MaxAttempts(70).DelayBetweenAttempts(5*time.Second), pod.MatchingSelector("app=webhook", certManagerNs))

t.LogStep("Wait for cert-manager-webhook service available")
retry.UntilSuccess(t, func(t test.TestHelper) {
oc.Get(t,
certManagerNs,
"service",
"cert-manager-webhook",
assert.OutputDoesNotContain("NotFound",
"Service \"cert-manager-webhook\" found",
"Service \"cert-manager-webhook\" not found"))
})

t.LogStep("Create root ca")
oc.ApplyString(t, certManagerNs, rootCA)
Expand Down
11 changes: 4 additions & 7 deletions pkg/tests/tasks/security/certmanager/istio_csr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ func TestIstioCsr(t *testing.T) {
if ocpVersion.LessThan(version.OCP_4_12) {
t.Skip("istio-csr is not supported in OCP older than v4.12")
}
if env.GetArch() == "z" || env.GetArch() == "p" {
t.Skip("istio-csr is not supported for IBM Z&P")
}

meshValues := map[string]string{
"Name": smcpName,
Expand Down Expand Up @@ -73,7 +70,7 @@ func TestIstioCsr(t *testing.T) {
helm.Namespace(meshNamespace).
Chart("jetstack/cert-manager-istio-csr").
Release("istio-csr").
Version("v0.6.0").
Version("v0.10.0").
ValuesString(template.Run(t, istioCsrTmpl, istioCsrValues)).
Install(t)
oc.WaitDeploymentRolloutComplete(t, meshNamespace, "cert-manager-istio-csr")
Expand All @@ -92,7 +89,7 @@ func TestIstioCsr(t *testing.T) {
t.LogStep("Verify that istio-ca-root-cert not created in non-member namespaces")
oc.LogsFromPods(t, meshNamespace, "app=cert-manager-istio-csr",
assert.OutputDoesNotContain(
fmt.Sprintf(`"msg"="creating configmap with root CA data" "configmap"="istio-ca-root-cert" "namespace"="%s"`, ns.Bar),
fmt.Sprintf(`creating configmap with root CA data logger=controller.configmap namespace=%s configmap=istio-ca-root-cert`, ns.Bar),
fmt.Sprintf("istio-ca-root-cert not created in %s", ns.Bar),
fmt.Sprintf("istio-ca-root-cert created in %s", ns.Bar)))

Expand All @@ -114,8 +111,8 @@ func TestIstioCsr(t *testing.T) {
func assertIstioCARootCertCreatedOrUpdated(ns string) common.CheckFunc {
return assert.OutputContainsAny(
[]string{
fmt.Sprintf(`"msg"="creating configmap with root CA data" "configmap"="istio-ca-root-cert" "namespace"="%s"`, ns),
fmt.Sprintf(`"msg"="updating ConfigMap data" "configmap"="istio-ca-root-cert" "namespace"="%s"`, ns),
fmt.Sprintf(`creating configmap with root CA data logger=controller.configmap namespace=%s configmap=istio-ca-root-cert`, ns),
fmt.Sprintf(`updating ConfigMap data logger=controller.configmap namespace=%s configmap=istio-ca-root-cert`, ns),
},
fmt.Sprintf("istio-ca-root-cert created or updated in %s", ns),
fmt.Sprintf("istio-ca-root-cert neither created nor updated in %s", ns))
Expand Down
3 changes: 0 additions & 3 deletions pkg/tests/tasks/security/certmanager/plugin_ca_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ func TestPluginCaCert(t *testing.T) {
if ocpVersion.LessThan(version.OCP_4_12) {
t.Skip("istio-csr is not supported in OCP older than v4.12")
}
if env.GetArch() == "z" || env.GetArch() == "p" {
t.Skip("istio-csr is not supported for IBM Z&P")
}

meshValues := map[string]interface{}{
"Name": smcpName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ replicaCount: 2

image:
repository: quay.io/jetstack/cert-manager-istio-csr
tag: v0.6.0
pullSecretName: ""
tag: v0.10.0

app:
certmanager:
Expand Down

0 comments on commit cec403a

Please sign in to comment.