Merge "Checks: Run the helm template plugin against charts"

This commit is contained in:
Jenkins 2017-06-12 22:44:05 +00:00 committed by Gerrit Code Review
commit 0a8dfeb517
2 changed files with 27 additions and 1 deletions

View File

@ -81,3 +81,21 @@ function helm_test_deployment {
kubectl logs -n openstack ${DEPLOYMENT}-rally-test > ${LOGS_DIR}/rally/${DEPLOYMENT}
kubectl delete -n openstack pod ${DEPLOYMENT}-rally-test
}
function helm_plugin_template_install {
# NOTE(portdirect): the helm plugin install command does not seem to respect the --version flag with helm 2.3.0
#helm plugin install https://github.com/technosophos/helm-template --version 2.3.0.1
TMP_DIR=$(mktemp -d)
curl -sSL https://github.com/technosophos/helm-template/releases/download/2.3.0%2B1/helm-template-linux-2.3.0.1.tgz | tar -zxv -C ${TMP_DIR}
mkdir -p ${HOME}/.helm/plugins/
mv ${TMP_DIR}/ ${HOME}/.helm/plugins/helm-template
rm -rf ${TMP_DIR}
}
function helm_template_run {
mkdir -p ${LOGS_DIR}/templates
for CHART in $(helm search | awk '{ print $1 }' | tail -n +2 | awk -F '/' '{ print $NF }'); do
echo "Running Helm template plugin on chart: $CHART"
helm template --verbose $CHART > ${LOGS_DIR}/templates/$CHART
done
}

View File

@ -25,7 +25,7 @@ source ${WORK_DIR}/tools/gate/funcs/network.sh
source ${WORK_DIR}/tools/gate/funcs/helm.sh
# Setup the logging location: by default use the working dir as the root.
export LOGS_DIR=${LOGS_DIR:-"${WORK_DIR}/logs/"}
export LOGS_DIR=${LOGS_DIR:-"${WORK_DIR}/logs"}
mkdir -p ${LOGS_DIR}
function dump_logs () {
@ -48,6 +48,14 @@ helm_install
helm_serve
helm_lint
# In the linter, we also run the helm template plugin to get a sanity check
# of the chart without verifying against the k8s API
if [ "x$INTEGRATION_TYPE" == "xlinter" ]; then
helm_build > ${LOGS_DIR}/helm_build
helm_plugin_template_install
helm_template_run
fi
# Setup the K8s Cluster
if [ "x$INTEGRATION" == "xaio" ]; then
bash ${WORK_DIR}/tools/gate/kubeadm_aio.sh