Run helm dependency on every chart

pull/532/head
Caleb Bron 2020-08-11 14:51:34 -07:00
parent c1ede43dc1
commit 943d41ec5b
2 changed files with 21 additions and 25 deletions

View File

@ -39,6 +39,14 @@ for f in packages/*; do
if [[ "${split_crds}" == "true" ]]; then if [[ "${split_crds}" == "true" ]]; then
./scripts/prepare-crds ${f} ./scripts/prepare-crds ${f}
fi fi
fi
fi
done
# Loop through packages again and copy dependencies over
# If sub-charts existed as package.yaml they will now be vendored into parent
for f in packages/*; do
if [[ -z $CHART || $CHART == $(basename -- ${f}) ]]; then
copied_dependencies=() copied_dependencies=()
if [[ -f ${f}/charts/requirements.yaml ]]; then if [[ -f ${f}/charts/requirements.yaml ]]; then
repos=$(cat ${f}/charts/requirements.yaml | yq r - "dependencies.*.repository") repos=$(cat ${f}/charts/requirements.yaml | yq r - "dependencies.*.repository")
@ -61,16 +69,4 @@ for f in packages/*; do
rm -rf $dep rm -rf $dep
done done
fi fi
fi
done
# if any sub-charts were prepared pull them in
for f in packages/*; do
if [[ ! -f ${f}/package.yaml && -f ${f}/charts/requirements.yaml ]]; then
ls ${f}/charts/requirements.yaml
pwd=$(pwd)
cd ${f}/charts
helm dependency update
cd $pwd
fi
done done

View File

@ -50,7 +50,7 @@ for crd_yaml in ${f}/charts-crd/templates/*; do
crd_group=$(yq r ${crd_yaml} 'spec.group') crd_group=$(yq r ${crd_yaml} 'spec.group')
crd_kind=$(yq r ${crd_yaml} 'spec.names.kind') crd_kind=$(yq r ${crd_yaml} 'spec.names.kind')
crd_version=$(yq r ${crd_yaml} 'spec.version') crd_version=$(yq r ${crd_yaml} 'spec.version')
if test -z "$crd_version"; then if [[ -z "$crd_version" ]]; then
crd_version=$(yq r ${crd_yaml} 'spec.versions[0].name') crd_version=$(yq r ${crd_yaml} 'spec.versions[0].name')
fi fi
crd_apis+=("${crd_group}/${crd_version}/${crd_kind}") crd_apis+=("${crd_group}/${crd_version}/${crd_kind}")