@@ -143,16 +143,21 @@ check_envsubst_available
143143MANIFEST=" ${MANIFEST:- " " } "
144144# Template can have params to substitute
145145DEFAULT_TEMPLATE=" https://raw.githubusercontent.com/Altinity/clickhouse-operator/master/deploy/operator/clickhouse-operator-install-template.yaml"
146- TEMPLATE=" ${TEMPLATE:- " ${DEFAULT_TEMPLATE} " } "
146+ TEMPLATE=" ${TEMPLATE:- ${DEFAULT_TEMPLATE} } "
147147# Namespace to install operator
148148OPERATOR_NAMESPACE=" ${OPERATOR_NAMESPACE:- " kube-system" } "
149149METRICS_EXPORTER_NAMESPACE=" ${OPERATOR_NAMESPACE} "
150+ # Whether OPERATOR_VERSION was explicitly set (non-empty)
150151# Operator's docker image
151152if [[ -z " ${OPERATOR_VERSION} " ]]; then
152153 # Going for default template
153154 RELEASE_VERSION=$( get_file https://raw.githubusercontent.com/Altinity/clickhouse-operator/master/release)
155+ OPERATOR_VERSION=" ${RELEASE_VERSION} "
156+ else
157+ TEMPLATE=" https://raw.githubusercontent.com/Altinity/clickhouse-operator/${OPERATOR_VERSION} /deploy/operator/clickhouse-operator-install-template.yaml"
158+ RELEASE_VERSION=${OPERATOR_VERSION}
154159fi
155- OPERATOR_VERSION= " ${OPERATOR_VERSION :- " ${RELEASE_VERSION} " } "
160+
156161OPERATOR_IMAGE=" ${OPERATOR_IMAGE:- " altinity/clickhouse-operator:${OPERATOR_VERSION} " } "
157162OPERATOR_IMAGE_PULL_POLICY=" ${OPERATOR_IMAGE_PULL_POLICY:- " Always" } "
158163METRICS_EXPORTER_IMAGE=" ${METRICS_EXPORTER_IMAGE:- " altinity/metrics-exporter:${OPERATOR_VERSION} " } "
@@ -199,4 +204,4 @@ elif [[ ! -z "${TEMPLATE}" ]]; then
199204 )
200205else
201206 echo " Neither manifest nor template available. Abort."
202- fi
207+ fi
0 commit comments