From 12679ff57b368b8483eac5de6c7064595f34bcee Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Fri, 6 Feb 2026 16:43:52 -0500 Subject: [PATCH] Support selective chart publishing via arguments Allow specifying individual chart names as arguments (3+) to publish only those charts instead of all charts in the directory. This provides more flexibility and faster publishing when only specific charts need to be updated. Usage: - ./publish-oci-charts.sh [root] [charts_dir] - publishes all charts - ./publish-oci-charts.sh [root] [charts_dir] chart1 chart2... - publishes only specified charts Signed-off-by: Tamal Saha --- hack/scripts/publish-oci-charts.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/hack/scripts/publish-oci-charts.sh b/hack/scripts/publish-oci-charts.sh index 55c67d244..0b988d034 100755 --- a/hack/scripts/publish-oci-charts.sh +++ b/hack/scripts/publish-oci-charts.sh @@ -40,11 +40,21 @@ REGISTRY_2=${REGISTRY_2:-} mkdir -p $SCRIPT_ROOT/.oci cd $SCRIPT_ROOT/.oci -for file in $SCRIPT_ROOT/$CHARTS_DIR/*; do - if [ -d "$file" ]; then - helm package "$file" - fi -done +if [ $# -gt 2 ]; then + # Loop over the chart names provided as arguments + for chart in "${@:3}"; do + if [ -d "$SCRIPT_ROOT/$CHARTS_DIR/$chart" ]; then + helm package "$SCRIPT_ROOT/$CHARTS_DIR/$chart" + fi + done +else + # Loop over all charts + for file in $SCRIPT_ROOT/$CHARTS_DIR/*; do + if [ -d "$file" ]; then + helm package "$file" + fi + done +fi for file in $SCRIPT_ROOT/.oci/*; do if [ -n "$REGISTRY_0" ]; then