Skip to content

Commit

Permalink
Set --agent-version if no BUILD_AGENT set;
Browse files Browse the repository at this point in the history
  • Loading branch information
ycliuhw committed Mar 21, 2022
1 parent 1943edc commit c871d29
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/includes/juju.sh
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ juju_bootstrap() {

pre_bootstrap

command="juju bootstrap ${series} ${model_default_series} --build-agent=${BUILD_AGENT} ${cloud_region} ${name} -d ${model} ${BOOTSTRAP_ADDITIONAL_ARGS}"
command="juju bootstrap ${series} ${model_default_series} ${cloud_region} ${name} -d ${model} ${BOOTSTRAP_ADDITIONAL_ARGS}"
# keep $@ here, otherwise hit SC2124
${command} "$@" 2>&1 | OUTPUT "${output}"
echo "${name}" >>"${TEST_DIR}/jujus"
Expand All @@ -265,6 +265,17 @@ pre_bootstrap() {
export BOOTSTRAP_ADDITIONAL_ARGS="${BOOTSTRAP_ADDITIONAL_ARGS} --metadata-source ${image_streams_dir}"
;;
esac

if [[ ${BUILD_AGENT:-} == true ]]; then
export BOOTSTRAP_ADDITIONAL_ARGS="${BOOTSTRAP_ADDITIONAL_ARGS:-} --build-agent=${BUILD_AGENT}"
else
# In CI tests, both Build and OfficialBuild are set.
# Juju confuses when it needs to decide the operator image tag to use.
# So we need to explicitely set the agent version for CI tests.
version=$(juju_version)
export BOOTSTRAP_ADDITIONAL_ARGS="${BOOTSTRAP_ADDITIONAL_ARGS:-} --agent-version=${version}"
fi
echo "BOOTSTRAP_ADDITIONAL_ARGS => ${BOOTSTRAP_ADDITIONAL_ARGS}"
}

# post_bootstrap contains actions required after bootstrap specific to providers
Expand Down

0 comments on commit c871d29

Please sign in to comment.