diff --git a/tools/document/validate_site_docs.sh b/tools/document/validate_site_docs.sh index 3bb8ae728..69354f488 100755 --- a/tools/document/validate_site_docs.sh +++ b/tools/document/validate_site_docs.sh @@ -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 diff --git a/tools/validate_docs b/tools/validate_docs index 167a520c5..b0bb7083c 100755 --- a/tools/validate_docs +++ b/tools/validate_docs @@ -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****************" diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index e526329be..a3e228f2b 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -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