Skip to content

Commit f81f363

Browse files
authored
fix: infinity loop fork bomb on nested helm-git calls (#189)
1 parent d1d27fe commit f81f363

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

helm-git-plugin.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,20 @@ helm_package() {
125125
helm_dependency_update() {
126126
_target_path=$1
127127

128-
# shellcheck disable=SC2086
129-
"$HELM_BIN" dependency update $helm_args --skip-refresh "$_target_path" >/dev/null
128+
# Prevent infinity loop when calling helm-git plugin
129+
if [ "$HELM_GIT_DEPENDENCY_CIRCUITBREAKER" = 1 ]; then
130+
# shellcheck disable=SC2086
131+
"$HELM_BIN" dependency update $helm_args --skip-refresh "$_target_path" >/dev/null
132+
ret=$?
133+
else
134+
# shellcheck disable=SC2086
135+
"$HELM_BIN" dependency update $helm_args "$_target_path" >/dev/null
136+
ret=$?
137+
export HELM_GIT_DEPENDENCY_CIRCUITBREAKER=1
138+
fi
139+
140+
# forward return code
141+
return $ret
130142
}
131143

132144
# helm_index(target_path, base_url)

0 commit comments

Comments
 (0)