Re-enable doc validation gate

This sets the validation gate to be voting again; it had been turned
off while some work was in flight.  However, the check is passing again
and re-enabling it will help ensure document goodness.

A couple of tweaks were made based on issues seen during multi-cluster
testing:

1. The kind cluster is now torn down between each cluster (eph and target).
   We'd been reusing the cluster for the sake of speed, but deleting
   everything out of it still left some unexplained cruft behind,
   which broke validation of the second (target) cluster.

2. This reverts back to a simple approach to phase selection and sequencing,
   away from a fancier technique which was failing the only phase
   was "initinfra".

Note: once `airshipctl phase validate` and a queryable phase map are
in place, the gate should be reworked to leverage them instead.

Change-Id: I37c51e859e2df880981e2e138a67c23e17eabd93
This commit is contained in:
Matt McEuen 2020-07-23 18:55:09 -05:00
parent bf3017c12f
commit 2dbd13c644
3 changed files with 19 additions and 15 deletions

View File

@ -96,12 +96,19 @@ users:
EOL
}
function cleanup() {
${KIND} delete cluster --name airship
rm -rf ${TMP}
}
trap cleanup EXIT
# Loop over all cluster types and phases for the given site
for cluster in ephemeral target; do
# Clear out any CRDs left from testing of a previous cluster
${KUBECTL} --context ${CONTEXT} --kubeconfig ${KUBECONFIG} delete crd --all > /dev/null
if [[ -d "manifests/site/${SITE}/${cluster}" ]]; then
echo -e "\n**** Rendering phases for cluster: ${cluster}"
# Start a fresh, empty kind cluster for validating documents
./tools/document/start_kind.sh
# Since we'll be mucking with the kubeconfig - make a copy of it and muck with the copy
cp ${KUBECONFIG} ${AIRSHIPKUBECONFIG}
# This is a big hack to work around kubeconfig reconciliation
@ -110,9 +117,13 @@ for cluster in ephemeral target; do
generate_airshipconf ${cluster}
${ACTL} cluster init
phases="bootstrap initinfra "
ignore=$(for i in $phases; do echo "-I $i "; done)
phases+=$(ls $ignore manifests/site/${SITE}/${cluster}| grep -v "\.yaml$")
# A sequential list of potential phases. A fancier attempt at this has been
# removed since it was choking in certain cases and got to be more trouble than was worth.
# This should be removed once we have a phase map that is smarter.
# In the meantime, as new phases are added, please add them here as well.
phases="bootstrap initinfra controlplane baremetalhost workers workload tenant"
for phase in $phases; do
# Guard against bootstrap or initinfra being missing, which could be the case for some configs
if [ -d "manifests/site/${SITE}/${cluster}/${phase}" ]; then
@ -130,5 +141,7 @@ for cluster in ephemeral target; do
${ACTL} phase apply --dry-run ${phase}
fi
done
${KIND} delete cluster --name airship
fi
done

View File

@ -22,14 +22,7 @@ TMP=$(KIND_URL=${KIND_URL} ./tools/document/get_kind.sh)
export KIND=${TMP}/kind
export KUBECTL_URL
function cleanup() {
${KIND} delete cluster --name airship
rm -rf ${TMP}
}
trap cleanup EXIT
./tools/document/build_kustomize_plugin.sh
./tools/document/start_kind.sh
for site in $(ls manifests/site); do
echo -e "\nValidating site: ${site}\n****************"

View File

@ -56,8 +56,6 @@
- ./tools/deployment/01_install_kubectl.sh
- ./tools/deployment/21_systemwide_executable.sh
- ./tools/validate_docs
# TODO (dukov) remove this once phases framework is fully implemented
voting: false
- job:
name: airship-airshipctl-functional-existing-k8s