diff options
author | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2018-01-24 21:02:40 +0100 |
---|---|---|
committer | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2018-01-28 19:29:09 +0100 |
commit | 29ad01ff1a3ee720b161008c1395f5ee9127ab9d (patch) | |
tree | e07e67e0ae294505f964263cc25a6f58f10d3710 /config/utils | |
parent | f666a4aaaefb41c93c2ccc36987b3f2dabb0e7d2 (diff) |
[IDF] Add optional 'idf.installer' array
There is no easy way to determine automatically if a PDF/IDF set is
compatible with a specific installer adapter.
Most common incompatibilities are caused by:
- installer adapters hardcode more network ports than nodes have
defined in PDF;
- installer adapters hardcode more nodes than PDF defines;
Previous attempt at handling this dynamically (cd54edf) fails for
recently added PODs, so let's handle this explicitly per-pod via a
new optional IDF property, 'idf.installer'.
If 'idf.installer' is defined, it will be used by `check-jinja2.sh`
as a filter-in list of installer adapters to check against.
The default (no 'idf.installer' present) is to check all IAs.
Leverage the new property for:
- arm-pod5: not enough network ports on computes for Compass, Joid;
- arm-pod7: same as arm-pod5;
- bii-pod1: no 'storage' network defined in IDF for Daisy;
- zte-pod9: 3 cluster nodes are only supported by Daisy for now;
SPEC changes:
- net_config (previously mandatory for IDF version '0.1') is now
mandatory only if 'idf.fuel' or 'idf.daisy' is defined;
Fixes: cd54edf
Change-Id: I706c05519e5491ad631069d7cc090e9c8bfd3011
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'config/utils')
-rwxr-xr-x | config/utils/check-jinja2.sh | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/config/utils/check-jinja2.sh b/config/utils/check-jinja2.sh index b7fa5912..16e52130 100755 --- a/config/utils/check-jinja2.sh +++ b/config/utils/check-jinja2.sh @@ -35,27 +35,19 @@ done # shellcheck disable=SC2086 while IFS= read -r lab_config; do SUMMARY+="\n${lab_config#labs/};" - lab_nodes=$(grep -ce 'node:' "${lab_config}") - lab_tmacs=$(grep -ce 'mac_address:' "${lab_config}") - ((lab_amacs=lab_tmacs/lab_nodes)); ((lab_nodes-=1)) + idf_config="$(dirname "${lab_config}")/idf-$(basename "${lab_config}")" + idf_installer=$(grep 'installer:' "${idf_config}" 2>/dev/null || echo) echo "###################### ${lab_config} ######################" for adapter in ${INSTALLER_ADAPTERS}; do pdf_inst=0 pdf_inst_pass=0 pdf_yaml_pass=0 - ia_nodes=$(grep -hPo 'nodes\W+\K\d+' -R "${adapter}" | tail -1) - ia_rmacs=$(grep -hPo 'interfaces\W+\K\d+' -R "${adapter}" | sort | tail -1) - ((ia_nodes+=1)); ((ia_rmacs+=1)) - if [[ ${ia_nodes} -gt ${lab_nodes} ]]; then + installer_name=$(basename "${adapter}") + if [ -n "${idf_installer}" ] && echo "${idf_installer}" | \ + grep -vq "${installer_name}"; then SUMMARY+='-;' - echo -n "[GENERATE] [SKIP] $(basename "${adapter}") requires at least" - echo -e " ${ia_nodes} nodes, but found only ${lab_nodes}, skipping.\n" - continue - fi - if [[ ${ia_rmacs} -ge ${lab_amacs} ]]; then - SUMMARY+='-;' - echo -n "[GENERATE] [SKIP] $(basename "${adapter}") requires at least" - echo -e " ${ia_rmacs} nics, but found ~ ${lab_amacs}, skipping.\n" + echo -n "[GENERATE] [SKIP] idf.installer defined and " + echo -e "${installer_name} not listed, skipping.\n" continue fi while IFS= read -r jinja_template; do |