@@ -83,6 +83,21 @@ if [[ "${SOLR_IMAGE}" != *":"* ]]; then
8383 SOLR_IMAGE=" solr:${SOLR_IMAGE} "
8484fi
8585
86+ export LOCATION=" $LOCATION "
87+ export VERSION=" $VERSION "
88+
89+ function add_solr_helm_repo() {
90+ if (echo " ${LOCATION} " | grep " http" ); then
91+ helm repo add --force-update " apache-solr-test-${VERSION} " " ${LOCATION} /helm-charts"
92+ fi
93+ }
94+
95+ function remove_solr_helm_repo() {
96+ if (echo " ${LOCATION} " | grep " http" ); then
97+ helm repo remove " apache-solr-test-${VERSION} "
98+ fi
99+ }
100+
86101# If LOCATION is not a URL, then get the absolute path
87102if ! (echo " ${LOCATION} " | grep " http" ); then
88103 LOCATION=$( cd " ${LOCATION} " ; pwd)
94109 # If LOCATION is a URL, then we want to make sure we have the up-to-date docker image.
95110 docker pull " ${IMAGE} "
96111
97- # Add the Test Helm Repo
98- helm repo add --force-update " apache-solr-test-${VERSION} " " ${LOCATION} /helm-charts"
99-
100112 OP_HELM_CHART=" apache-solr-test-${VERSION} /solr-operator"
101113 SOLR_HELM_CHART=" apache-solr-test-${VERSION} /solr"
102114fi
@@ -147,6 +159,8 @@ if [[ -n "${GPG_KEY:-}" ]]; then
147159 fi
148160fi
149161
162+ add_solr_helm_repo
163+
150164# Install the Solr Operator
151165kubectl create -f " ${LOCATION} /crds/all-with-dependencies.yaml" || kubectl replace -f " ${LOCATION} /crds/all-with-dependencies.yaml"
152166helm install --kube-context " ${KUBE_CONTEXT} " ${VERIFY_OR_NOT} solr-operator " ${OP_HELM_CHART} " \
@@ -169,9 +183,7 @@ helm install --kube-context "${KUBE_CONTEXT}" ${VERIFY_OR_NOT} example "${SOLR_H
169183 --set " backupRepositories[0].volume.source.hostPath.path=/tmp/backup"
170184
171185# If LOCATION is a URL, then remove the helm repo after use
172- if (echo " ${LOCATION} " | grep " http" ); then
173- helm repo remove " apache-solr-test-${VERSION} "
174- fi
186+ remove_solr_helm_repo
175187
176188# Wait for solrcloud to be ready
177189printf ' \nWait for all 3 Solr nodes to become ready.\n\n'
277289
278290
279291printf " \nDo a rolling restart and make sure the cluster is healthy afterwards\n"
280-
292+ add_solr_helm_repo
281293helm upgrade --kube-context " ${KUBE_CONTEXT} " ${VERIFY_OR_NOT} example " ${SOLR_HELM_CHART} " --reuse-values \
282294 --set-string podOptions.annotations.restart=" true"
283295printf ' \nWait for the rolling restart to begin.\n\n'
284296grep -q " 3 [[:digit:]] [[:digit:]] 0" <( exec kubectl get solrcloud example -w) ; kill $!
297+ remove_solr_helm_repo
285298
286299printf ' \nWait 5 minutes for all 3 Solr nodes to become ready.\n\n'
287300grep -q " 3 3 3 3" <( exec kubectl get solrcloud example -w --request-timeout 300) ; kill $!
0 commit comments