Skip to content

Commit

Permalink
chore(KFLUXVNGD-183): add retries to tkn bundle push
Browse files Browse the repository at this point in the history
Add retry to tkn bundle push command
Updated files after running `hack/generate-ta-tasks.sh`
and `./hack/build-manifests.sh`

Signed-off-by: Avi Biton <[email protected]>
  • Loading branch information
avi-biton committed Feb 5, 2025
1 parent 5e0950d commit 3f43cb5
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
19 changes: 18 additions & 1 deletion task/tkn-bundle-oci-ta/0.1/tkn-bundle-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,25 @@ spec:
exit 1
exec 3>&1
retry() {
local status
local retry=0
local -r interval=${RETRY_INTERVAL:-5}
local -r max_retries=5
while true; do
"$@" && break
status=$?
((retry += 1))
if [ $retry -gt $max_retries ]; then
return $status
fi
echo "info: Waiting for a while, then retry ..." 1>&2
sleep "$interval"
done
}
# shellcheck disable=SC2046
OUT="$(tkn bundle push "$IMAGE" \
OUT="$(retry tkn bundle push "$IMAGE" \
$(printf ' -f %s' "${FILES[@]}") |
tee /proc/self/fd/3)"
echo -n "$IMAGE" >"$(results.IMAGE_URL.path)"
Expand Down
19 changes: 18 additions & 1 deletion task/tkn-bundle/0.1/tkn-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,25 @@ spec:
&& exit 1
exec 3>&1;
retry() {
local status
local retry=0
local -r interval=${RETRY_INTERVAL:-5}
local -r max_retries=5
while true; do
"$@" && break
status=$?
((retry+=1))
if [ $retry -gt $max_retries ]; then
return $status
fi
echo "info: Waiting for a while, then retry ..." 1>&2
sleep "$interval"
done
}
# shellcheck disable=SC2046
OUT="$(tkn bundle push "$IMAGE" \
OUT="$(retry tkn bundle push "$IMAGE" \
$(printf ' -f %s' "${FILES[@]}") \
|tee /proc/self/fd/3)"
echo -n "$IMAGE" > "$(results.IMAGE_URL.path)"
Expand Down

0 comments on commit 3f43cb5

Please sign in to comment.