Skip to content

Commit

Permalink
Fix 2327: Detecting OLM existence before start to install (#2334)
Browse files Browse the repository at this point in the history
* Fix 2327

Signed-off-by: Ying Mo <morningspace@yahoo.com>

* Remove -o=jsonpath='{.spec}'

Signed-off-by: Ying Mo <morningspace@yahoo.com>
  • Loading branch information
morningspace authored Aug 31, 2021
1 parent c20784d commit 03493b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if [[ ${#@} -lt 1 || ${#@} -gt 2 ]]; then
exit 1
fi

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

if kubectl get deployment olm-operator -n ${namespace} > /dev/null 2>&1; then
echo "OLM is already installed in ${namespace} namespace. Exiting..."
exit 1
fi

kubectl apply -f "${url}/crds.yaml"
kubectl wait --for=condition=Established -f "${url}/crds.yaml"
kubectl apply -f "${url}/olm.yaml"
Expand Down

0 comments on commit 03493b5

Please sign in to comment.