diff --git a/scripts/install.sh b/scripts/install.sh index 35c65b35ce..8d592a9ede 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -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 @@ -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"