Skip to content

Commit 03493b5

Browse files
authored
Fix 2327: Detecting OLM existence before start to install (#2334)
* Fix 2327 Signed-off-by: Ying Mo <[email protected]> * Remove -o=jsonpath='{.spec}' Signed-off-by: Ying Mo <[email protected]>
1 parent c20784d commit 03493b5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/install.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [[ ${#@} -lt 1 || ${#@} -gt 2 ]]; then
1414
exit 1
1515
fi
1616

17-
if kubectl get deployment olm-operator -n openshift-operator-lifecycle-manager -o=jsonpath='{.spec}' > /dev/null 2>&1; then
17+
if kubectl get deployment olm-operator -n openshift-operator-lifecycle-manager > /dev/null 2>&1; then
1818
echo "OLM is already installed in a different configuration. This is common if you are not running a vanilla Kubernetes cluster. Exiting..."
1919
exit 1
2020
fi
@@ -24,6 +24,11 @@ base_url="${2:-${default_base_url}}"
2424
url="${base_url}/${release}"
2525
namespace=olm
2626

27+
if kubectl get deployment olm-operator -n ${namespace} > /dev/null 2>&1; then
28+
echo "OLM is already installed in ${namespace} namespace. Exiting..."
29+
exit 1
30+
fi
31+
2732
kubectl apply -f "${url}/crds.yaml"
2833
kubectl wait --for=condition=Established -f "${url}/crds.yaml"
2934
kubectl apply -f "${url}/olm.yaml"

0 commit comments

Comments
 (0)