Skip to content

Commit

Permalink
IEBH-345: handle OCI registry URLs in add chart script (#142)
Browse files Browse the repository at this point in the history
When using OCI registry URLs (e.g. oci://registry-1.docker.io/bitnamicharts/kafka),
the chart name extraction was failing because it assumed a two-segment path.
Modified extract_chart_name() to properly handle OCI URLs by extracting the last
path segment as the chart name.
  • Loading branch information
acascais authored Oct 29, 2024
1 parent ffd232d commit e05c47c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions add_chart_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ check_arguments() {

extract_chart_name() {
if [[ $1 == "--release" ]]; then
echo $2
echo $2
else
echo $1 | cut -d "/" -f 2
if [[ $1 == oci://* ]]; then
# For OCI URLs, take the last segment
echo $1 | rev | cut -d "/" -f 1 | rev
else
# For regular helm repo charts
echo $1 | cut -d "/" -f 2
fi
fi
}

Expand Down

0 comments on commit e05c47c

Please sign in to comment.