Skip to content

Commit

Permalink
fix validate-chart scripts:
Browse files Browse the repository at this point in the history
- clean-up temp yaml file
- fix k8s version check
- fix rke2-coredns templating
  • Loading branch information
thomasferrandiz committed Dec 22, 2023
1 parent d9d53cb commit 9a4f6ce
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions scripts/validate-charts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ check_system_registry() {
chart_tmp=$3

yaml_tmp=$(mktemp --suffix .yaml)
values="global.systemDefaultRegistry=my-registry,global.cattle.systemDefaultRegistry=my-registry,vCenter.clusterId=test-id"
values="global.systemDefaultRegistry=my-registry,global.cattle.systemDefaultRegistry=my-registry,vCenter.clusterId=test-id,global.clusterDNS=10.43.0.10"
helm template test-chart --kube-version ${KUBERNETES_VERSION} --set $values $chart_tmp > $yaml_tmp;

awk '$1 ~ /^image:/ {
Expand All @@ -60,6 +60,9 @@ check_system_registry() {
}
}
' $yaml_tmp

#clean-up
rm -f $yaml_tmp
}

is_supported() {
Expand Down Expand Up @@ -110,7 +113,7 @@ check_airgap() {
chart_tmp=$3

yaml_tmp=$(mktemp --suffix .yaml)
values="vCenter.clusterId=test-id"
values="vCenter.clusterId=test-id,global.clusterDNS=10.43.0.10"
helm template test-chart --kube-version ${KUBERNETES_VERSION} --set $values $chart_tmp > $yaml_tmp;

chart_folder=$(mktemp -d)
Expand All @@ -120,7 +123,7 @@ check_airgap() {
print $3 " " $5
}
' $chart_folder/$chart_name/Chart.yaml `
if ! [ -z ${version_annotation} ]; then
if ! [[ -z ${version_annotation} ]]; then
version_annotation=${version_annotation:0:-1}
read lower_bound upper_bound <<< $version_annotation

Expand All @@ -143,6 +146,9 @@ check_airgap() {
echo $image
fi
done

#clean-up
rm -f $yaml_tmp
}

declare -A NO_SYSTEM_REGISTRY
Expand Down

0 comments on commit 9a4f6ce

Please sign in to comment.