Fix docker provisioner on Arm64
Modify Puppet modulepath for puppetlabs-4.12 to
fix "Unknown function: 'any2array'" issue.
Fix 'shellcheck' warnings.
@@ -82,7 +82,9 @@ create() {
fi
# Get the headnode FQDN
+ # shellcheck disable=SC2207
NODES=(`docker-compose -p $PROVISION_ID ps -q`)
+ # shellcheck disable=SC1083
hadoop_head_node=`docker inspect --format {{.Config.Hostname}}.{{.Config.Domainname}} ${NODES[0]}`
# Fetch configurations form specificed yaml config file
@@ -90,7 +92,7 @@ create() {
repo=$(get-yaml-config repo)
fi
if [ -z ${components+x} ]; then
- components="[`echo $(get-yaml-config components) | sed 's/ /, /g'`]"
+ components="[`echo "$(get-yaml-config components)" | sed 's/ /, /g'`]"
fi
if [ -z ${distro+x} ]; then
distro=$(get-yaml-config distro)
@@ -179,7 +181,7 @@ provision() {
smoke-tests() {
hadoop_head_node=${NODES:0:12}
if [ -z ${smoke_test_components+x} ]; then
- smoke_test_components="`echo $(get-yaml-config smoke_test_components) | sed 's/ /,/g'`"
+ smoke_test_components="`echo "$(get-yaml-config smoke_test_components)" | sed 's/ /,/g'`"
fi
docker exec $hadoop_head_node bash -c "bash -x /bigtop-home/provisioner/utils/smoke-tests.sh $smoke_test_components"
}
@@ -201,7 +203,8 @@ bigtop-puppet() {
if docker exec $1 bash -c "puppet --version" | grep ^3 >/dev/null ; then
future="--parser future"
fi
- docker exec $1 bash -c "puppet apply --detailed-exitcodes $future --hiera_config=/etc/puppet/hiera.yaml --modulepath=/bigtop-home/bigtop-deploy/puppet/modules:/etc/puppet/modules:/usr/share/puppet/modules:/etc/puppetlabs/code/environments/production/modules /bigtop-home/bigtop-deploy/puppet/manifests"
+ # BIGTOP-3401 Modify Puppet modulepath for puppetlabs-4.12
+ docker exec $1 bash -c "puppet apply --detailed-exitcodes $future --hiera_config=/etc/puppet/hiera.yaml --modulepath=/bigtop-home/bigtop-deploy/puppet/modules:/etc/puppet/modules:/usr/share/puppet/modules:/etc/puppetlabs/code/modules /bigtop-home/bigtop-deploy/puppet/manifests"
}
get-yaml-config() {
@@ -222,11 +225,11 @@ execute() {
if [[ $1 =~ $re ]] ; then
no=$1
shift
- docker exec -ti ${NODES[$((no-1))]} $@
+ docker exec -ti ${NODES[$((no-1))]} "$@"
else
name=$1
shift
- docker exec -ti $name $@
+ docker exec -ti $name "$@"
fi
}
@@ -274,6 +277,7 @@ if [ -e .provision_id ]; then
PROVISION_ID=`cat .provision_id`
fi
if [ -n "$PROVISION_ID" ]; then
+ # shellcheck disable=SC2207
NODES=(`docker-compose -p $PROVISION_ID ps -q`)
fi
@@ -304,7 +308,7 @@ while [ $# -gt 0 ]; do
usage
fi
shift
- execute $@
+ execute "$@"
shift $#;;
-E|--env-check)
env-check
