Cosmetic cleanups + copyright
chart_version_check.sh
hart_versions.sh
helmlint.sh
helmrepo.sh
wait_for_jobs.sh
wait_for_pods.sh
----------------------
o Indentation erratic so use editor formatting to set a clean baseline.
o Update copyright notice to span 2024.
Change-Id: I21e3cd8fd997c24d6fcd03edc1caef5315bb7f63
diff --git a/helmlint.sh b/helmlint.sh
index f9614c9..f26ea5b 100755
--- a/helmlint.sh
+++ b/helmlint.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# -----------------------------------------------------------------------
-# Copyright 2018-2023 Open Networking Foundation (ONF) and the ONF Contributors
+# Copyright 2018-2024 Open Networking Foundation (ONF) and the ONF Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -42,8 +42,8 @@
# if [[ $# -gt 0 ]] && [[ "$1" = 'clean' ]]; then <--- allow set -u
if [ "$1" = "clean" ]
then
- echo "Removing any downloaded charts"
- find "${WORKSPACE}" -type d -name 'charts' -exec rm -rf {} \;
+ echo "Removing any downloaded charts"
+ find "${WORKSPACE}" -type d -name 'charts' -exec rm -rf {} \;
fi
# now that $1 is checked, error on undefined vars
@@ -52,51 +52,51 @@
# loop on result of 'find -name Chart.yaml'
while IFS= read -r -d '' chart
do
- chartdir=$(dirname "${chart}")
+ chartdir=$(dirname "${chart}")
- echo "Checking chart: $chartdir"
+ echo "Checking chart: $chartdir"
- # update dependencies (if any)
- if ! helm dependency update "${chartdir}";
- then
- fail_lint=1
- failed_deps+=("${chartdir}")
- fi
-
- # lint the chart (with values.yaml if it exists)
- if [ -f "${chartdir}/values.yaml" ]; then
- helm lint --strict --values "${chartdir}/values.yaml" "${chartdir}"
- else
- helm lint --strict "${chartdir}"
- fi
-
- rc=$?
- if [[ $rc != 0 ]]; then
- fail_lint=1
- failed_lint+=("${chartdir}")
- fi
-
- # -----------------------------------------------------------------------
- # check that requirements are available if they're specified
- # how is this check different than helm dep up above ?
- # -----------------------------------------------------------------------
- # later helm versions allow requirements.yaml to be defined directly in
- # Chart.yaml so an explicit check may no longer be needed.
- #
- # Should we err when requirements.yaml detected to cleanup old code ?
- # -----------------------------------------------------------------------
- if [ -f "${chartdir}/requirements.yaml" ];
- then
- echo "Chart has requirements.yaml, checking availability"
- if ! helm dependency update "${chartdir}"; then
- fail_lint=1
- failed_reqs+=("${chartdir}")
+ # update dependencies (if any)
+ if ! helm dependency update "${chartdir}";
+ then
+ fail_lint=1
+ failed_deps+=("${chartdir}")
fi
- # remove charts dir after checking for availability, as this chart might be
- # required by other charts in the next loop
- rm -rf "${chartdir}/charts"
- fi
+ # lint the chart (with values.yaml if it exists)
+ if [ -f "${chartdir}/values.yaml" ]; then
+ helm lint --strict --values "${chartdir}/values.yaml" "${chartdir}"
+ else
+ helm lint --strict "${chartdir}"
+ fi
+
+ rc=$?
+ if [[ $rc != 0 ]]; then
+ fail_lint=1
+ failed_lint+=("${chartdir}")
+ fi
+
+ # -----------------------------------------------------------------------
+ # check that requirements are available if they're specified
+ # how is this check different than helm dep up above ?
+ # -----------------------------------------------------------------------
+ # later helm versions allow requirements.yaml to be defined directly in
+ # Chart.yaml so an explicit check may no longer be needed.
+ #
+ # Should we err when requirements.yaml detected to cleanup old code ?
+ # -----------------------------------------------------------------------
+ if [ -f "${chartdir}/requirements.yaml" ];
+ then
+ echo "Chart has requirements.yaml, checking availability"
+ if ! helm dependency update "${chartdir}"; then
+ fail_lint=1
+ failed_reqs+=("${chartdir}")
+ fi
+
+ # remove charts dir after checking for availability, as this chart might be
+ # required by other charts in the next loop
+ rm -rf "${chartdir}/charts"
+ fi
done < <(find "${WORKSPACE}" -name Chart.yaml -print0)
@@ -109,36 +109,36 @@
EOM
# echo "Charts that failed to lint: $failed_lint"
- if [ ${#failed_lint[@]} -gt 0 ]; then
- echo "Charts that failed to lint:"
- for chart in "${failed_lint[@]}";
- do
- echo " $chart"
- done
- fi
+ if [ ${#failed_lint[@]} -gt 0 ]; then
+ echo "Charts that failed to lint:"
+ for chart in "${failed_lint[@]}";
+ do
+ echo " $chart"
+ done
+ fi
- if [ ${#failed_deps[@]} -gt 0 ]; then
- echo "Charts that failed helm dependency update:"
- for chart in "${failed_deps[@]}";
- do
- echo " $chart"
- done
- fi
+ if [ ${#failed_deps[@]} -gt 0 ]; then
+ echo "Charts that failed helm dependency update:"
+ for chart in "${failed_deps[@]}";
+ do
+ echo " $chart"
+ done
+ fi
- if [ ${#failed_reqs[@]} -gt 0 ]; then
- echo "Charts with failures in requirements.yaml:"
- for chart in "${failed_reqs[@]}";
- do
- echo " $chart"
- done
- fi
+ if [ ${#failed_reqs[@]} -gt 0 ]; then
+ echo "Charts with failures in requirements.yaml:"
+ for chart in "${failed_reqs[@]}";
+ do
+ echo " $chart"
+ done
+ fi
- echo
- echo "See Also:"
- echo " o https://wiki.opennetworking.org/display/VOLTHA/make+lint-helm"
-
- echo
- exit 1
+ echo
+ echo "See Also:"
+ echo " o https://wiki.opennetworking.org/display/VOLTHA/make+lint-helm"
+
+ echo
+ exit 1
fi
echo "# helmlint.sh Success! - all charts linted and have valid requirements.yaml #"