|
40 | 40 | certManagerNamespace=$(oc get Subscriptions --all-namespaces -ojson | jq -r '.items[] | select(.spec.name == "cert-manager") | .metadata.namespace')
|
41 | 41 | if test -z "$certManagerNamespace"
|
42 | 42 | then
|
43 |
| - echo "cert-manager's namespace can't be determined, check that it is installed" |
44 |
| - oc get Subscriptions --all-namespaces |
45 |
| - exit 1 |
| 43 | + certManagerNamespace=$(oc get Subscriptions --all-namespaces -ojson | jq -r '.items[] | select(.spec.name == "openshift-cert-manager-operator") | .metadata.namespace') |
| 44 | + if test -z "$certManagerNamespace" |
| 45 | + then |
| 46 | + echo "cert-manager's namespace can't be determined, check that it is installed" |
| 47 | + oc get Subscriptions --all-namespaces |
| 48 | + exit 1 |
| 49 | + fi |
46 | 50 | fi
|
47 | 51 | echo "cert-manager's namespace: $certManagerNamespace"
|
48 | 52 |
|
49 | 53 | # retrieve the cluster domain to produce a valid cluster issuer
|
50 | 54 | clusterDomain=$(oc get -n openshift-ingress-operator ingresscontroller/default -o json | jq -r '.status.domain')
|
51 | 55 | if test -z "$certManagerNamespace"
|
52 | 56 | then
|
53 |
| - echo "The cluster domain can't be retrived" |
54 |
| - exit 1 |
| 57 | + echo "The cluster domain can't be retrived" |
| 58 | + exit 1 |
55 | 59 | fi
|
56 | 60 | echo "cluster domain: $clusterDomain"
|
57 | 61 |
|
58 | 62 | echo "deploying using image: ${API_SERVER_IMAGE}"
|
59 | 63 | oc kustomize deploy \
|
60 | 64 | | sed "s|image: .*|image: ${API_SERVER_IMAGE}|" \
|
61 | 65 | | sed "s|- issuer.mydomain.tld|- issuer.${clusterDomain}|" \
|
| 66 | + | sed "s|namespace: openshift-operators|namespace: ${certManagerNamespace}|" \ |
62 | 67 | | oc apply -f -
|
63 | 68 |
|
64 |
| - |
65 |
| -while ! kubectl get secret jolokia-api-server-selfsigned-ca-cert-secret --namespace openshift-operators; do echo "Waiting for the CA"; sleep 1; done |
| 69 | +while ! oc get secret jolokia-api-server-selfsigned-ca-cert-secret --namespace=${certManagerNamespace}; do echo "Waiting for the CA"; sleep 1; done |
66 | 70 | # copy the secret from the cert-manager namespace to the jolokia api server
|
67 | 71 | # namespace
|
68 | 72 | oc get secret jolokia-api-server-selfsigned-ca-cert-secret \
|
69 |
| - --namespace=openshift-operators -oyaml \ |
| 73 | + --namespace=${certManagerNamespace} -oyaml \ |
70 | 74 | | sed s/"namespace: ${certManagerNamespace}"/"namespace: activemq-artemis-jolokia-api-server"/\ \
|
71 |
| - | kubectl apply -n activemq-artemis-jolokia-api-server -f - |
| 75 | + | oc apply -n activemq-artemis-jolokia-api-server -f - |
0 commit comments