From 9fddcbdf3b369110ef835a196c733c939dace0a0 Mon Sep 17 00:00:00 2001 From: Stanislav Egorov Date: Thu, 9 Jul 2020 15:02:25 -0700 Subject: [PATCH] Fixed docs validation build Phases should be ordered when rendering to prevent error like: '... no matches for kind "Cluster" ...' Change-Id: I830c36b5959ae3970b261f96ff6d23bf467f5ff6 --- tools/document/validate_site_docs.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/document/validate_site_docs.sh b/tools/document/validate_site_docs.sh index 717e7011e..1fe458de2 100755 --- a/tools/document/validate_site_docs.sh +++ b/tools/document/validate_site_docs.sh @@ -109,12 +109,14 @@ for cluster in ephemeral target; do sed -i "s/${CONTEXT}/${CONTEXT}_${cluster}/" ${AIRSHIPKUBECONFIG} generate_airshipconf ${cluster} - for phase in $(ls manifests/site/${SITE}/${cluster}| grep -v "\.yaml$"); do + ${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$") + for phase in $phases; do echo -e "\n*** Rendering ${cluster}/${phase}" # step 1: actually apply all crds in the phase - # TODO: will need to loop through phases in order, eventually - # e.g., load CRDs from initinfra first, so they're present when validating later phases ${ACTL} phase render ${phase} -k CustomResourceDefinition > ${TMP}/crds.yaml if [ -s ${TMP}/crds.yaml ]; then ${KUBECTL} --context ${CONTEXT} --kubeconfig ${KUBECONFIG} apply -f ${TMP}/crds.yaml