Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install.sh does not work if you have never installed OLM before #2210

Closed
jmazzitelli opened this issue Jun 21, 2021 · 6 comments · Fixed by #2211
Closed

install.sh does not work if you have never installed OLM before #2210

jmazzitelli opened this issue Jun 21, 2021 · 6 comments · Fixed by #2211
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@jmazzitelli
Copy link
Contributor

I'm looking to install OLM in a fresh new minikube. I go to the operatorhub.io page and it tells me to run install.sh to install OLM:

image

I run that and it does nothing. Silently exits with no messages, no errors, no nothing:

$ curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.18.2/install.sh | bash -s v0.18.2
$ 

The problem is this: https://github.com/operator-framework/operator-lifecycle-manager/blob/v0.18.2/scripts/install.sh#L17-L18

kubectl get deployment olm-operator -n openshift-operator-lifecycle-manager -o=jsonpath='{.spec}' > /dev/null 2>&1
...

That silently exits the script because of the set -e on line 6.

Suggest you either remove line 6 or refactor that kubectl call + if-stmt so it doesn't abort on non-0 exit code (which is what you typically will expect here because someone running this most likely doesn't have OLM yet).

@jmazzitelli jmazzitelli added the kind/bug Categorizes issue or PR as related to a bug. label Jun 21, 2021
@timflannagan
Copy link
Contributor

Another user was running into this problem in d7eead7.

@jmazzitelli
Copy link
Contributor Author

I think this will fix it:

$ diff /tmp/olm-install.sh.ORIG /tmp/olm-install.sh
17,18c17
< kubectl get deployment olm-operator -n openshift-operator-lifecycle-manager -o=jsonpath='{.spec}' > /dev/null 2>&1
< if [[ $? -eq 0 ]]; then
---
> if kubectl get deployment olm-operator -n openshift-operator-lifecycle-manager -o=jsonpath='{.spec}' > /dev/null 2>&1; then

@jmazzitelli
Copy link
Contributor Author

jmazzitelli commented Jun 21, 2021

That script is doing something now that I fixed it as I describe above:

$ /tmp/olm-install.sh v0.18.2
customresourcedefinition.apiextensions.k8s.io/catalogsources.operators.coreos.com created
customresourcedefinition.apiextensions.k8s.io/clusterserviceversions.operators.coreos.com created
customresourcedefinition.apiextensions.k8s.io/installplans.operators.coreos.com created
customresourcedefinition.apiextensions.k8s.io/operatorconditions.operators.coreos.com created
customresourcedefinition.apiextensions.k8s.io/operatorgroups.operators.coreos.com created
customresourcedefinition.apiextensions.k8s.io/operators.operators.coreos.com created
customresourcedefinition.apiextensions.k8s.io/subscriptions.operators.coreos.com created
customresourcedefinition.apiextensions.k8s.io/catalogsources.operators.coreos.com condition met
customresourcedefinition.apiextensions.k8s.io/clusterserviceversions.operators.coreos.com condition met
customresourcedefinition.apiextensions.k8s.io/installplans.operators.coreos.com condition met
customresourcedefinition.apiextensions.k8s.io/operatorconditions.operators.coreos.com condition met
customresourcedefinition.apiextensions.k8s.io/operatorgroups.operators.coreos.com condition met
customresourcedefinition.apiextensions.k8s.io/operators.operators.coreos.com condition met
customresourcedefinition.apiextensions.k8s.io/subscriptions.operators.coreos.com condition met
namespace/olm created
namespace/operators created
serviceaccount/olm-operator-serviceaccount created
clusterrole.rbac.authorization.k8s.io/system:controller:operator-lifecycle-manager created
clusterrolebinding.rbac.authorization.k8s.io/olm-operator-binding-olm created
deployment.apps/olm-operator created
deployment.apps/catalog-operator created
clusterrole.rbac.authorization.k8s.io/aggregate-olm-edit created
clusterrole.rbac.authorization.k8s.io/aggregate-olm-view created
operatorgroup.operators.coreos.com/global-operators created
operatorgroup.operators.coreos.com/olm-operators created
clusterserviceversion.operators.coreos.com/packageserver created
catalogsource.operators.coreos.com/operatorhubio-catalog created
Waiting for deployment "olm-operator" rollout to finish: 0 of 1 updated replicas are available...
deployment "olm-operator" successfully rolled out
deployment "catalog-operator" successfully rolled out
Package server phase: Installing
Package server phase: Succeeded
Waiting for deployment "packageserver" rollout to finish: 1 of 2 updated replicas are available...
deployment "packageserver" successfully rolled out

@timflannagan
Copy link
Contributor

@jmazzitelli SGTM - do you want to open a PR that fixes this script?

@jmazzitelli
Copy link
Contributor Author

PR: #2211

@jmazzitelli
Copy link
Contributor Author

Until that PR is merged and released, the workaround would be to just use sed to strip the set -e command (see command below). Just means if one of the other commands fails, the script will keep going, but, oh well. For now, good enough.

curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.18.2/install.sh | sed 's/set -e//g' | bash -s v0.18.2

jmazzitelli added a commit to jmazzitelli/operator-lifecycle-manager that referenced this issue Jun 21, 2021
fixes: operator-framework#2210
Signed-off-by: John Mazzitelli <mazz@redhat.com>
fantapsody pushed a commit to fantapsody/operator-lifecycle-manager that referenced this issue Jun 23, 2021
fixes: operator-framework#2210
Signed-off-by: John Mazzitelli <mazz@redhat.com>
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/operator-lifecycle-manager that referenced this issue Jun 28, 2021
fixes: operator-framework#2210
Signed-off-by: John Mazzitelli <mazz@redhat.com>
benluddy pushed a commit to benluddy/operator-framework-olm that referenced this issue Jul 1, 2021
fixes: operator-framework/operator-lifecycle-manager#2210
Signed-off-by: John Mazzitelli <mazz@redhat.com>

Upstream-repository: operator-lifecycle-manager
Upstream-commit: fb6e5e759952c76d9e8a21d203da6d1fd231f1c8
benluddy pushed a commit to benluddy/operator-framework-olm that referenced this issue Jul 2, 2021
fixes: operator-framework/operator-lifecycle-manager#2210
Signed-off-by: John Mazzitelli <mazz@redhat.com>

Upstream-repository: operator-lifecycle-manager
Upstream-commit: fb6e5e759952c76d9e8a21d203da6d1fd231f1c8
openshift-merge-robot pushed a commit to openshift/operator-framework-olm that referenced this issue Jul 14, 2021
fixes: operator-framework/operator-lifecycle-manager#2210
Signed-off-by: John Mazzitelli <mazz@redhat.com>

Upstream-repository: operator-lifecycle-manager
Upstream-commit: fb6e5e759952c76d9e8a21d203da6d1fd231f1c8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants