@@ -11,6 +11,7 @@ function printUsage() {
11
11
echo " ./${SCRIPT_NAME} -i|--image <image url>"
12
12
echo " Options: "
13
13
echo " -i|--image Specify the plugin image to deploy. (default is ${DEFAULT_IMAGE} )"
14
+ echo " -c|--certManagerNamespace give the namespace cert manager is installed in, will search for it in the Subscriptions otherwise"
14
15
echo " -h|--help Print this message."
15
16
}
16
17
@@ -25,6 +26,11 @@ while [[ $# -gt 0 ]]; do
25
26
shift
26
27
shift
27
28
;;
29
+ -c|--certManagerNamespace)
30
+ certManagerNamespace=" $2 "
31
+ shift
32
+ shift
33
+ ;;
28
34
-* |--* )
29
35
echo " Unknown option $1 "
30
36
printUsage
@@ -35,17 +41,21 @@ while [[ $# -gt 0 ]]; do
35
41
esac
36
42
done
37
43
38
- # find the cert-manager operator namespace, if this can't be retrived there's no
39
- # possibility to proceed
40
- certManagerNamespace=$( oc get Subscriptions --all-namespaces -ojson | jq -r ' .items[] | select(.spec.name == "cert-manager") | .metadata.namespace' )
44
+ # if the user has overridden the certManagerNamespace don't try to search for it
41
45
if test -z " $certManagerNamespace "
42
- then
43
- certManagerNamespace=$( oc get Subscriptions --all-namespaces -ojson | jq -r ' .items[] | select(.spec.name == "openshift-cert-manager-operator") | .metadata.namespace' )
46
+ then
47
+ # find the cert-manager operator namespace, if this can't be retrived there's no
48
+ # possibility to proceed
49
+ certManagerNamespace=$( oc get Subscriptions --all-namespaces -ojson | jq -r ' .items[] | select(.spec.name == "cert-manager") | .metadata.namespace' )
44
50
if test -z " $certManagerNamespace "
45
51
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
52
+ certManagerNamespace=$( oc get Subscriptions --all-namespaces -ojson | jq -r ' .items[] | select(.spec.name == "openshift-cert-manager-operator") | .metadata.namespace' )
53
+ if test -z " $certManagerNamespace "
54
+ then
55
+ echo " Error: cert-manager's namespace can't be determined"
56
+ oc get Subscriptions --all-namespaces
57
+ exit 1
58
+ fi
49
59
fi
50
60
fi
51
61
echo " cert-manager's namespace: $certManagerNamespace "
0 commit comments